tor-browser

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

secure.https.html (2144B)


      1 <!doctype html>
      2 <html>
      3  <head>
      4    <meta charset=utf-8>
      5    <title>Test cookie secure attribute parsing</title>
      6    <meta name=help href="https://tools.ietf.org/html/rfc6265#section-5.2.5">
      7    <meta name="timeout" content="long">
      8    <script src="/resources/testharness.js"></script>
      9    <script src="/resources/testharnessreport.js"></script>
     10    <script src="/resources/testdriver.js"></script>
     11    <script src="/resources/testdriver-vendor.js"></script>
     12    <script src="/cookies/resources/cookie-test.js"></script>
     13  </head>
     14  <body>
     15    <div id=log></div>
     16    <script>
     17      const secureTests = [
     18        {
     19          cookie: "test=1; Secure",
     20          expected: "test=1",
     21          name: "Set cookie for Secure attribute",
     22        },
     23        {
     24          cookie: "test=2; seCURe",
     25          expected: "test=2",
     26          name: "Set cookie for seCURe attribute",
     27        },
     28        {
     29          cookie: "test=3; Secure=",
     30          expected: "test=3",
     31          name: "Set cookie for for Secure= attribute",
     32        },
     33        {
     34          cookie: "test=4; Secure=aaaa",
     35          expected: "test=4",
     36          name: "Set cookie for Secure=aaaa",
     37        },
     38        {
     39          cookie: "test=5; Secure =aaaaa",
     40          expected: "test=5",
     41          name: "Set cookie for Secure space equals",
     42        },
     43        {
     44          cookie: "test=6; Secure= aaaaa",
     45          expected: "test=6",
     46          name: "Set cookie for Secure equals space",
     47        },
     48        {
     49          cookie: "test=7;                Secure",
     50          expected: "test=7",
     51          name: "Set cookie for spaced Secure",
     52        },
     53        {
     54          cookie: "test=8;       Secure     ;",
     55          expected: "test=8",
     56          name: "Set cookie for space Secure with ;",
     57        },
     58        {
     59          cookie: ["testa9a=x; secure; ", "; secure", "testa9b=y; secure;"],
     60          expected: "testa9a=x; testa9b=y",
     61          name: "Ignore name- and value-less `Set-Cookie: ; secure`",
     62        },
     63      ];
     64 
     65      for (const test of secureTests) {
     66        httpCookieTest(test.cookie, test.expected, test.name, test.defaultPath);
     67      }
     68    </script>
     69  </body>
     70 </html>