2014-03-18 16:36:18 +00:00
|
|
|
// test that methods are not normalized
|
2014-10-24 22:16:29 +00:00
|
|
|
|
2020-04-07 16:00:03 +00:00
|
|
|
"use strict";
|
|
|
|
|
2014-03-18 16:36:18 +00: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 00:10:14 +00:00
|
|
|
var chan = NetUtil.newChannel({
|
|
|
|
uri: "http://localhost/",
|
|
|
|
loadUsingSystemPrincipal: true,
|
|
|
|
}).QueryInterface(Ci.nsIHttpChannel);
|
2014-03-18 16:36:18 +00:00
|
|
|
|
|
|
|
for (var i = 0; i < testMethods.length; i++) {
|
|
|
|
chan.requestMethod = testMethods[i];
|
|
|
|
Assert.equal(chan.requestMethod, testMethods[i]);
|
|
|
|
}
|
|
|
|
}
|