diff options
author | Maximilian Hils <git@maximilianhils.com> | 2016-10-16 23:49:54 -0700 |
---|---|---|
committer | Maximilian Hils <git@maximilianhils.com> | 2016-10-16 23:49:54 -0700 |
commit | 02d3d618204bce2bc0ed088a556a94a8479dcf31 (patch) | |
tree | e4c0913d0c4675c815d0e0ffa3b53d9cab3f5937 | |
parent | 43a83c89e73905daa7ebc27313a45546f0a33f61 (diff) | |
download | mitmproxy-02d3d618204bce2bc0ed088a556a94a8479dcf31.tar.gz mitmproxy-02d3d618204bce2bc0ed088a556a94a8479dcf31.tar.bz2 mitmproxy-02d3d618204bce2bc0ed088a556a94a8479dcf31.zip |
fix redirect_requests.py example
-rw-r--r-- | examples/redirect_requests.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/examples/redirect_requests.py b/examples/redirect_requests.py index 8cde1bfd..bbb84e2f 100644 --- a/examples/redirect_requests.py +++ b/examples/redirect_requests.py @@ -11,8 +11,7 @@ def request(flow): # Method 1: Answer with a locally generated response if flow.request.pretty_host.endswith("example.com"): - resp = HTTPResponse.make(200, b"Hello World", {"Content-Type": "text/html"}) - flow.reply.send(resp) + flow.response = 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"): |