aboutsummaryrefslogtreecommitdiffstats
path: root/examples/stream_modify.py
diff options
context:
space:
mode:
authorMaximilian Hils <git@maximilianhils.com>2015-09-04 00:47:04 +0200
committerMaximilian Hils <git@maximilianhils.com>2015-09-04 00:47:04 +0200
commite88c7e4c58a862d6a222d1f8d4638102228b929e (patch)
treea801f9bc87ff8f6a7e0cedc37ab57c2edc69cb4a /examples/stream_modify.py
parent2d1c382f38d3b1cf9219ddb9b62ef196a4381976 (diff)
parentee8e5947df4af80d85d255d087f94a5f98722ef0 (diff)
downloadmitmproxy-e88c7e4c58a862d6a222d1f8d4638102228b929e.tar.gz
mitmproxy-e88c7e4c58a862d6a222d1f8d4638102228b929e.tar.bz2
mitmproxy-e88c7e4c58a862d6a222d1f8d4638102228b929e.zip
Merge branch 'master' into readthedocs
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):