aboutsummaryrefslogtreecommitdiffstats
path: root/examples/redirect_requests.py
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2016-06-08 10:44:20 +1200
committerAldo Cortesi <aldo@nullcube.com>2016-06-08 10:44:20 +1200
commita388ddfd781fd05a414c07cac8446ef151cbd1d2 (patch)
treead0181e2bfd3408c4e5398e5959da914612dc54b /examples/redirect_requests.py
parent982077ec31ddffeab9830a02b425c35cb0b0dac5 (diff)
downloadmitmproxy-a388ddfd781fd05a414c07cac8446ef151cbd1d2.tar.gz
mitmproxy-a388ddfd781fd05a414c07cac8446ef151cbd1d2.tar.bz2
mitmproxy-a388ddfd781fd05a414c07cac8446ef151cbd1d2.zip
A new interface for reply
Reply is now explicit - it's no longer a callable itself. Instead, we have: reply.kill() - kill the flow reply.ack() - ack, but don't send anything reply.send(message) - send a response This is part of an incremental move to detach reply from our flow objects, and unify the script and handler interfaces.
Diffstat (limited to 'examples/redirect_requests.py')
-rw-r--r--examples/redirect_requests.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/examples/redirect_requests.py b/examples/redirect_requests.py
index 3ff8f9e4..d7db3f1c 100644
--- a/examples/redirect_requests.py
+++ b/examples/redirect_requests.py
@@ -16,7 +16,7 @@ def request(context, flow):
"HTTP/1.1", 200, "OK",
Headers(Content_Type="text/html"),
"helloworld")
- flow.reply(resp)
+ flow.reply.send(resp)
# Method 2: Redirect the request to a different server
if flow.request.pretty_host.endswith("example.org"):