aboutsummaryrefslogtreecommitdiffstats
path: root/examples/redirect_requests.py
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@corte.si>2016-10-19 21:26:54 +1300
committerGitHub <noreply@github.com>2016-10-19 21:26:54 +1300
commitb1cf9dd5e38d5386199dff8c49e0dc1b46d8ec72 (patch)
treefee98428fbf36897aa874fd91fe5c9738bf2626f /examples/redirect_requests.py
parent49346c5248b8aa33acef26f0d55f51dcd2493a59 (diff)
parent24cf8da27eb56a65bf3e4ceb78bbeacdb1864597 (diff)
downloadmitmproxy-b1cf9dd5e38d5386199dff8c49e0dc1b46d8ec72.tar.gz
mitmproxy-b1cf9dd5e38d5386199dff8c49e0dc1b46d8ec72.tar.bz2
mitmproxy-b1cf9dd5e38d5386199dff8c49e0dc1b46d8ec72.zip
Merge pull request #1633 from cortesi/refactor2
Continue module structure cleanup
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 bbb84e2f..c28042db 100644
--- a/examples/redirect_requests.py
+++ b/examples/redirect_requests.py
@@ -1,7 +1,7 @@
"""
This example shows two ways to redirect flows to other destinations.
"""
-from mitmproxy.models import HTTPResponse
+from mitmproxy import http
def request(flow):
@@ -11,7 +11,7 @@ def request(flow):
# Method 1: Answer with a locally generated response
if flow.request.pretty_host.endswith("example.com"):
- flow.response = HTTPResponse.make(200, b"Hello World", {"Content-Type": "text/html"})
+ flow.response = http.HTTPResponse.make(200, b"Hello World", {"Content-Type": "text/html"})
# Method 2: Redirect the request to a different server
if flow.request.pretty_host.endswith("example.org"):