tor-browser

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

url-parsing.sub.html (1204B)


      1 <!-- Based on /html/infrastructure/urls/resolving-urls/query-encoding/location.sub.html -->
      2 <!doctype html>
      3 <meta charset={{GET[encoding]}}> <!-- ends up as <meta charset> by default which is windows-1252 -->
      4 <meta name=variant content="?encoding=windows-1252">
      5 <meta name=variant content="?encoding=x-cp1251">
      6 <meta name=variant content="?encoding=utf8">
      7 <script src=/resources/testharness.js></script>
      8 <script src=/resources/testharnessreport.js></script>
      9 <div id=log></div>
     10 <script>
     11 function expected(encoding) {
     12  return {
     13    "UTF-8": "%C3%BF",
     14    "windows-1251": "%26%23255%3B",
     15    "windows-1252": "%FF"
     16  }[encoding];
     17 }
     18 
     19 test(() => {
     20  const request = new Request("?\u00FF");
     21  assert_equals(request.url.split("?")[1], expected("UTF-8"));
     22 }, "Request uses the UTF-8 URL parser");
     23 
     24 test(() => {
     25  const request = new Request("about:blank", { referrer: "?\u00FF" });
     26  assert_equals(request.referrer.split("?")[1], expected("UTF-8"));
     27 }, "Request's referrer uses the UTF-8 URL parser");
     28 
     29 test(() => {
     30  const response = Response.redirect("?\u00FF");
     31  assert_equals(response.headers.get("Location").split("?")[1], expected("UTF-8"));
     32 }, "Response.redirect() uses the UTF-8 URL parser");
     33 </script>