tor-browser

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

bad-chunk-encoding.py (447B)


      1 import time
      2 
      3 def main(request, response):
      4    delay = float(request.GET.first(b"ms", 1000)) / 1E3
      5    count = int(request.GET.first(b"count", 50))
      6    time.sleep(delay)
      7    response.headers.set(b"Transfer-Encoding", b"chunked")
      8    response.write_status_headers()
      9    time.sleep(delay)
     10    for i in range(count):
     11        response.writer.write_content(b"a\r\nTEST_CHUNK\r\n")
     12        time.sleep(delay)
     13    response.writer.write_content(b"garbage")