diff options
author | Maximilian Hils <git@maximilianhils.com> | 2016-01-08 17:33:03 +0100 |
---|---|---|
committer | Maximilian Hils <git@maximilianhils.com> | 2016-01-08 17:33:03 +0100 |
commit | f07008b8a640fcece90199b1e5ed44e0126a5d58 (patch) | |
tree | 33f7c3631faf4516640b791cb60414ab6d415d78 /examples/redirect_requests.py | |
parent | 11215e46ecc5c3a4272893d4b06f71920ff126f5 (diff) | |
parent | 27b801ebe298b29f522ae1268330f7e2404b0212 (diff) | |
download | mitmproxy-f07008b8a640fcece90199b1e5ed44e0126a5d58.tar.gz mitmproxy-f07008b8a640fcece90199b1e5ed44e0126a5d58.tar.bz2 mitmproxy-f07008b8a640fcece90199b1e5ed44e0126a5d58.zip |
Merge pull request #878 from warting/patch-1
Update redirect_requests.py
Diffstat (limited to 'examples/redirect_requests.py')
-rw-r--r-- | examples/redirect_requests.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/redirect_requests.py b/examples/redirect_requests.py index 5cc81633..a3145083 100644 --- a/examples/redirect_requests.py +++ b/examples/redirect_requests.py @@ -12,11 +12,11 @@ def request(context, flow): # Method 1: Answer with a locally generated response if flow.request.pretty_host.endswith("example.com"): resp = HTTPResponse( - [1, 1], 200, "OK", + "HTTP/1.1", 200, "OK", Headers(Content_Type="text/html"), "helloworld") flow.reply(resp) # Method 2: Redirect the request to a different server if flow.request.pretty_host.endswith("example.org"): - flow.request.host = "mitmproxy.org"
\ No newline at end of file + flow.request.host = "mitmproxy.org" |