tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

test_bug477578.js (810B)


      1 // test that methods are not normalized
      2 
      3 "use strict";
      4 
      5 const testMethods = [
      6  ["GET"],
      7  ["get"],
      8  ["Get"],
      9  ["gET"],
     10  ["gEt"],
     11  ["post"],
     12  ["POST"],
     13  ["head"],
     14  ["HEAD"],
     15  ["put"],
     16  ["PUT"],
     17  ["delete"],
     18  ["DELETE"],
     19  ["connect"],
     20  ["CONNECT"],
     21  ["options"],
     22  ["trace"],
     23  ["track"],
     24  ["copy"],
     25  ["index"],
     26  ["lock"],
     27  ["m-post"],
     28  ["mkcol"],
     29  ["move"],
     30  ["propfind"],
     31  ["proppatch"],
     32  ["unlock"],
     33  ["link"],
     34  ["LINK"],
     35  ["foo"],
     36  ["foO"],
     37  ["fOo"],
     38  ["Foo"],
     39 ];
     40 
     41 function run_test() {
     42  var chan = NetUtil.newChannel({
     43    uri: "http://localhost/",
     44    loadUsingSystemPrincipal: true,
     45  }).QueryInterface(Ci.nsIHttpChannel);
     46 
     47  for (var i = 0; i < testMethods.length; i++) {
     48    chan.requestMethod = testMethods[i];
     49    Assert.equal(chan.requestMethod, testMethods[i]);
     50  }
     51 }