diff options
author | Maximilian Hils <git@maximilianhils.com> | 2015-09-05 20:45:58 +0200 |
---|---|---|
committer | Maximilian Hils <git@maximilianhils.com> | 2015-09-05 20:45:58 +0200 |
commit | 5125c669ccd2db5de5f90c66db61e64f63f3ba4c (patch) | |
tree | 6773ffcaada096f7e02c54665b733c1bad350e98 /examples/redirect_requests.py | |
parent | 00561d280ccd4aac06b13b434e0aef4492148cb5 (diff) | |
download | mitmproxy-5125c669ccd2db5de5f90c66db61e64f63f3ba4c.tar.gz mitmproxy-5125c669ccd2db5de5f90c66db61e64f63f3ba4c.tar.bz2 mitmproxy-5125c669ccd2db5de5f90c66db61e64f63f3ba4c.zip |
adjust to new netlib Headers class
Diffstat (limited to 'examples/redirect_requests.py')
-rw-r--r-- | examples/redirect_requests.py | 5 |
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) |