tor-browser

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

syntax.any.js (747B)


      1 // META: script=/common/get-host-info.sub.js
      2 
      3 const crossOriginURL = get_host_info().HTTP_REMOTE_ORIGIN + "/fetch/cross-origin-resource-policy/resources/hello.py?corp=";
      4 
      5 [
      6  "same",
      7  "same, same-origin",
      8  "SAME-ORIGIN",
      9  "Same-Origin",
     10  "same-origin, <>",
     11  "same-origin, same-origin",
     12  "https://www.example.com",  // See https://github.com/whatwg/fetch/issues/760
     13 ].forEach(incorrectHeaderValue => {
     14  // Note: an incorrect value results in a successful load, so this test is only meaningful in
     15  // implementations with support for the header.
     16  promise_test(t => {
     17    return fetch(crossOriginURL + encodeURIComponent(incorrectHeaderValue), { mode: "no-cors" });
     18  }, "Parsing Cross-Origin-Resource-Policy: " + incorrectHeaderValue);
     19 });