2014-03-18 20:36:18 +04:00
|
|
|
// test that methods are not normalized
|
2014-10-25 02:16:29 +04:00
|
|
|
|
2020-04-07 19:00:03 +03:00
|
|
|
"use strict";
|
|
|
|
|
2014-03-18 20:36:18 +04:00
|
|
|
const testMethods = [
|
|
|
|
["GET"],
|
|
|
|
["get"],
|
|
|
|
["Get"],
|
|
|
|
["gET"],
|
|
|
|
["gEt"],
|
|
|
|
["post"],
|
|
|
|
["POST"],
|
|
|
|
["head"],
|
|
|
|
["HEAD"],
|
|
|
|
["put"],
|
|
|
|
["PUT"],
|
|
|
|
["delete"],
|
|
|
|
["DELETE"],
|
|
|
|
["connect"],
|
|
|
|
["CONNECT"],
|
|
|
|
["options"],
|
|
|
|
["trace"],
|
|
|
|
["track"],
|
|
|
|
["copy"],
|
|
|
|
["index"],
|
|
|
|
["lock"],
|
|
|
|
["m-post"],
|
|
|
|
["mkcol"],
|
|
|
|
["move"],
|
|
|
|
["propfind"],
|
|
|
|
["proppatch"],
|
|
|
|
["unlock"],
|
|
|
|
["link"],
|
|
|
|
["LINK"],
|
|
|
|
["foo"],
|
|
|
|
["foO"],
|
|
|
|
["fOo"],
|
|
|
|
["Foo"],
|
|
|
|
];
|
|
|
|
|
|
|
|
function run_test() {
|
2016-02-17 03:10:14 +03:00
|
|
|
var chan = NetUtil.newChannel({
|
|
|
|
uri: "http://localhost/",
|
|
|
|
loadUsingSystemPrincipal: true,
|
|
|
|
}).QueryInterface(Ci.nsIHttpChannel);
|
2014-03-18 20:36:18 +04:00
|
|
|
|
|
|
|
for (var i = 0; i < testMethods.length; i++) {
|
|
|
|
chan.requestMethod = testMethods[i];
|
|
|
|
Assert.equal(chan.requestMethod, testMethods[i]);
|
|
|
|
}
|
|
|
|
}
|