aboutsummaryrefslogtreecommitdiffstats
path: root/examples/redirect_requests.py
diff options
context:
space:
mode:
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"):