diff options
author | Maximilian Hils <git@maximilianhils.com> | 2014-08-09 01:02:58 +0200 |
---|---|---|
committer | Maximilian Hils <git@maximilianhils.com> | 2014-08-09 01:02:58 +0200 |
commit | f4a1459ebeca7c72419bce17d931f8b2c846df5e (patch) | |
tree | f55df3386e7a5339a06003b0ce4ceb2ac9c92b5e /examples | |
parent | c88613f5963c804d33fe2a8868ddbb0634b3d5ad (diff) | |
download | mitmproxy-f4a1459ebeca7c72419bce17d931f8b2c846df5e.tar.gz mitmproxy-f4a1459ebeca7c72419bce17d931f8b2c846df5e.tar.bz2 mitmproxy-f4a1459ebeca7c72419bce17d931f8b2c846df5e.zip |
fix #274
Diffstat (limited to 'examples')
-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 278160c7..a9a7e795 100644 --- a/examples/redirect_requests.py +++ b/examples/redirect_requests.py @@ -7,12 +7,12 @@ This example shows two ways to redirect flows to other destinations. def request(context, flow): - if flow.request.host.endswith("example.com"): + if flow.request.get_host(hostheader=True).endswith("example.com"): resp = HTTPResponse( [1, 1], 200, "OK", ODictCaseless([["Content-Type", "text/html"]]), "helloworld") flow.request.reply(resp) - if flow.request.host.endswith("example.org"): + if flow.request.get_host(hostheader=True).endswith("example.org"): flow.request.host = "mitmproxy.org" flow.request.headers["Host"] = ["mitmproxy.org"] |