aboutsummaryrefslogtreecommitdiffstats
path: root/examples/stream_modify.py
diff options
context:
space:
mode:
authorMaximilian Hils <git@maximilianhils.com>2015-09-04 00:46:42 +0200
committerMaximilian Hils <git@maximilianhils.com>2015-09-04 00:46:42 +0200
commita18db90ea3123b37e3f1fd3f10da001a8ea893c2 (patch)
tree7e3ed5515b59a52ad14c5c8c3047ce5c2daae3d9 /examples/stream_modify.py
parent14457f29b3d89e234d0791c4980e5cf9514185dd (diff)
downloadmitmproxy-a18db90ea3123b37e3f1fd3f10da001a8ea893c2.tar.gz
mitmproxy-a18db90ea3123b37e3f1fd3f10da001a8ea893c2.tar.bz2
mitmproxy-a18db90ea3123b37e3f1fd3f10da001a8ea893c2.zip
update example inline scripts
Diffstat (limited to 'examples/stream_modify.py')
-rw-r--r--examples/stream_modify.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/examples/stream_modify.py b/examples/stream_modify.py
index e3f1f3cf..aa395c03 100644
--- a/examples/stream_modify.py
+++ b/examples/stream_modify.py
@@ -11,11 +11,9 @@ Be aware that content replacement isn't trivial:
def modify(chunks):
"""
chunks is a generator that can be used to iterate over all chunks.
- Each chunk is a (prefix, content, suffix) tuple.
- For example, in the case of chunked transfer encoding: ("3\r\n","foo","\r\n")
"""
- for prefix, content, suffix in chunks:
- yield prefix, content.replace("foo", "bar"), suffix
+ for chunk in chunks:
+ yield chunk.replace("foo", "bar")
def responseheaders(context, flow):