tor-browser

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

js.py (672B)


      1 def main(request, response):
      2    outcome = request.GET.first(b"outcome", b"f")
      3    type = request.GET.first(b"type", b"Content-Type missing")
      4 
      5    content = b"// nothing to see here"
      6    content += b"\n"
      7    content += b"log('FAIL: " + type + b"')" if (outcome == b"f") else b"p()"
      8 
      9    response.add_required_headers = False
     10    response.writer.write_status(200)
     11    response.writer.write_header(b"x-content-type-options", b"nosniff")
     12    response.writer.write_header(b"content-length", len(content))
     13    if(type != b"Content-Type missing"):
     14        response.writer.write_header(b"content-type", type)
     15    response.writer.end_headers()
     16 
     17    response.writer.write(content)