diff options
Diffstat (limited to 'examples/stream_modify.py')
-rw-r--r-- | examples/stream_modify.py | 6 |
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): |