test_bug589292.js (732B)
1 // Make sure we behave appropriately when asking for content-disposition 2 3 const { NetUtil } = ChromeUtils.importESModule( 4 "resource://gre/modules/NetUtil.sys.mjs" 5 ); 6 7 const path = "data/test_bug589292.zip"; 8 9 function run_test() { 10 var spec = 11 "jar:" + Services.io.newFileURI(do_get_file(path)).spec + "!/foo.txt"; 12 var channel = NetUtil.newChannel({ 13 uri: spec, 14 loadUsingSystemPrincipal: true, 15 }); 16 channel.open(); 17 try { 18 channel.contentDisposition; 19 Assert.ok(false, "The channel has content disposition?!"); 20 } catch (e) { 21 // This is what we want to happen - there's no underlying channel, so no 22 // content-disposition header is available 23 Assert.ok(true, "How are you reading this?!"); 24 } 25 }