aboutsummaryrefslogtreecommitdiffstats
path: root/examples/redirect_requests.py
diff options
context:
space:
mode:
authorMaximilian Hils <git@maximilianhils.com>2015-09-06 01:37:19 +0200
committerMaximilian Hils <git@maximilianhils.com>2015-09-06 01:37:19 +0200
commiteb2334c6cb7c9ab9c260bc609ae43fb53d441f6f (patch)
treea6b263b856bd035ac154b45fe7e91706918b25f3 /examples/redirect_requests.py
parent853cd810757a02252402da22ae77cab77c5a3fb6 (diff)
parenta8d931089c9ecf450b69321706825cf694c1c08e (diff)
downloadmitmproxy-eb2334c6cb7c9ab9c260bc609ae43fb53d441f6f.tar.gz
mitmproxy-eb2334c6cb7c9ab9c260bc609ae43fb53d441f6f.tar.bz2
mitmproxy-eb2334c6cb7c9ab9c260bc609ae43fb53d441f6f.zip
Merge branch 'master' into readthedocs
Diffstat (limited to 'examples/redirect_requests.py')
-rw-r--r--examples/redirect_requests.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/examples/redirect_requests.py b/examples/redirect_requests.py
index 2ae4927b..ca24c42a 100644
--- a/examples/redirect_requests.py
+++ b/examples/redirect_requests.py
@@ -2,8 +2,7 @@
This example shows two ways to redirect flows to other destinations.
"""
from libmproxy.models import HTTPResponse
-from netlib.odict import ODictCaseless
-
+from netlib.http import Headers
def request(context, flow):
# pretty_host(hostheader=True) takes the Host: header of the request into account,
@@ -14,7 +13,7 @@ def request(context, flow):
if flow.request.pretty_host(hostheader=True).endswith("example.com"):
resp = HTTPResponse(
[1, 1], 200, "OK",
- ODictCaseless([["Content-Type", "text/html"]]),
+ Headers(Content_Type="text/html"),
"helloworld")
flow.reply(resp)