diff options
author | Maximilian Hils <git@maximilianhils.com> | 2016-07-06 17:31:08 -0700 |
---|---|---|
committer | Maximilian Hils <git@maximilianhils.com> | 2016-07-06 17:31:08 -0700 |
commit | 444f0a4c397e3d664ce80f65d176d871b8e1194e (patch) | |
tree | f3013e551579c6513636856168f9747237702647 /examples/redirect_requests.py | |
parent | 811b72cd304a8c75efaf706fd57cfbe9494cd3d9 (diff) | |
download | mitmproxy-444f0a4c397e3d664ce80f65d176d871b8e1194e.tar.gz mitmproxy-444f0a4c397e3d664ce80f65d176d871b8e1194e.tar.bz2 mitmproxy-444f0a4c397e3d664ce80f65d176d871b8e1194e.zip |
py3++
Diffstat (limited to 'examples/redirect_requests.py')
-rw-r--r-- | examples/redirect_requests.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/examples/redirect_requests.py b/examples/redirect_requests.py index d7db3f1c..af2aa907 100644 --- a/examples/redirect_requests.py +++ b/examples/redirect_requests.py @@ -13,9 +13,10 @@ def request(context, flow): # Method 1: Answer with a locally generated response if flow.request.pretty_host.endswith("example.com"): resp = HTTPResponse( - "HTTP/1.1", 200, "OK", + b"HTTP/1.1", 200, b"OK", Headers(Content_Type="text/html"), - "helloworld") + b"helloworld" + ) flow.reply.send(resp) # Method 2: Redirect the request to a different server |