aboutsummaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2011-08-05 13:26:39 +1200
committerAldo Cortesi <aldo@nullcube.com>2011-08-05 13:26:39 +1200
commitcd0e2f18e6626f5d02ab749a001934a016eee966 (patch)
treee81b68b5224a3b9f440fc834cee990735f39fe19 /examples
parent89a58d7e303f00e4ed7572b60db6a2073804c4a1 (diff)
downloadmitmproxy-cd0e2f18e6626f5d02ab749a001934a016eee966.tar.gz
mitmproxy-cd0e2f18e6626f5d02ab749a001934a016eee966.tar.bz2
mitmproxy-cd0e2f18e6626f5d02ab749a001934a016eee966.zip
First draft of scripting docs.
Diffstat (limited to 'examples')
-rw-r--r--examples/add_header.py8
1 files changed, 2 insertions, 6 deletions
diff --git a/examples/add_header.py b/examples/add_header.py
index 6ddeab3d..0c0593d1 100644
--- a/examples/add_header.py
+++ b/examples/add_header.py
@@ -1,6 +1,2 @@
-"""
- This script adds a new header to all responses.
-"""
-
-def response(ctx, f):
- f.response.headers["newheader"] = ["foo"]
+def response(context, flow):
+ flow.response.headers["newheader"] = ["foo"]