tor-browser

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

file_sanitizer_on_paste.sjs (660B)


      1 function handleRequest(request, response) {
      2   if (request.queryString.includes("report")) {
      3     response.setHeader("Content-Type", "text/javascript", false);
      4     if (getState("loaded") == "loaded") {
      5       response.write(
      6         "ok(false, 'There was an attempt to preload the image.');"
      7       );
      8     } else {
      9       response.write("ok(true, 'There was no attempt to preload the image.');");
     10     }
     11     response.write("SimpleTest.finish();");
     12   } else {
     13     setState("loaded", "loaded");
     14     response.setHeader("Content-Type", "image/svg", false);
     15     response.write(
     16       "<svg xmlns='http://www.w3.org/2000/svg'>Not supposed to load this</svg>"
     17     );
     18   }
     19 }