aboutsummaryrefslogtreecommitdiffstats
path: root/examples/redirect_requests.py
diff options
context:
space:
mode:
authorSandor Nemes <snemes@users.noreply.github.com>2016-01-13 15:05:57 +0100
committerSandor Nemes <snemes@users.noreply.github.com>2016-01-13 15:05:57 +0100
commit2753af0ec72e542d5a4dc3e5e200bd1638b2b095 (patch)
tree8968dca61eac1d68288e85d5be1b0c680f015d6c /examples/redirect_requests.py
parentfe77dd35c67a0dfbd3004fefe97c689f8cfd3291 (diff)
parentaea3837d4ae637af42f716acb27d7ea8394ece35 (diff)
downloadmitmproxy-2753af0ec72e542d5a4dc3e5e200bd1638b2b095.tar.gz
mitmproxy-2753af0ec72e542d5a4dc3e5e200bd1638b2b095.tar.bz2
mitmproxy-2753af0ec72e542d5a4dc3e5e200bd1638b2b095.zip
Merge branch 'master' into master
Diffstat (limited to 'examples/redirect_requests.py')
-rw-r--r--examples/redirect_requests.py4
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"