3 const { HttpServer
} = ChromeUtils
.importESModule(
4 "resource://testing-common/httpd.sys.mjs"
9 function TestListener() {}
11 TestListener
.prototype.onStartRequest = function () {};
13 TestListener
.prototype.onStopRequest = function () {
14 httpserv
.stop(do_test_finished
);
18 httpserv
= new HttpServer();
20 httpserv
.registerPathHandler("/bug412945", bug412945
);
25 var channel
= NetUtil
.newChannel({
26 uri
: "http://localhost:" + httpserv
.identity
.primaryPort
+ "/bug412945",
27 loadUsingSystemPrincipal
: true,
30 channel
.QueryInterface(Ci
.nsIHttpChannel
);
31 channel
.requestMethod
= "POST";
32 channel
.asyncOpen(new TestListener(), null);
37 function bug412945(metadata
) {
39 !metadata
.hasHeader("Content-Length") ||
40 metadata
.getHeader("Content-Length") != "0"
42 do_throw("Content-Length header not found!");