tor-browser

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

file_http_background_auth_request.sjs (574B)


      1 // Custom *.sjs file specifically for the needs of Bug 1665062
      2 
      3 function handleRequest(request, response) {
      4   // avoid confusing cache behaviors
      5   response.setHeader("Cache-Control", "no-cache", false);
      6 
      7   if (request.scheme === "https") {
      8     response.setHeader("Content-Type", "text/html;charset=utf-8", false);
      9     response.setStatusLine(request.httpVersion, 401, "Unauthorized");
     10     response.setHeader("WWW-Authenticate", 'Basic realm="bug1665062"');
     11     return;
     12   }
     13 
     14   // we should never get here; just in case, return something unexpected
     15   response.write("do'h");
     16 }