tor-browser

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

bug289714.sjs (730B)


      1 // Send a payload that's over 32k in size, which for a plain response should be
      2 // large enough to ensure that OnDataAvailable is called more than once (and so
      3 // the XHR will be triggered to send more than one "loading" event if desired).
      4 
      5 function handleRequest(request, response) {
      6   // Send 81920 bytes of こんにちは in Shift-JIS encoding, framed in XML.
      7   let data =
      8     "<?xml version='1.0' encoding='shift-jis'?><xml>" +
      9     new Array(1 << 13).join("\x82\xb1\x82\xf1\x82\xc9\x82\xbf\x82\xcd") +
     10     "</xml>";
     11   response.processAsync();
     12   response.setHeader("Content-Type", "text/xml", false);
     13   response.setHeader("Content-Length", "" + data.length, false);
     14   response.write(data, data.length);
     15   response.finish();
     16 }