tor-browser

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

echo-content.py (505B)


      1 from wptserve.utils import isomorphic_encode
      2 
      3 def main(request, response):
      4 
      5    headers = [(b"X-Request-Method", isomorphic_encode(request.method)),
      6               (b"X-Request-Content-Length", request.headers.get(b"Content-Length", b"NO")),
      7               (b"X-Request-Content-Type", request.headers.get(b"Content-Type", b"NO")),
      8               # Avoid any kind of content sniffing on the response.
      9               (b"Content-Type", b"text/plain")]
     10    content = request.body
     11 
     12    return headers, content