From a18db90ea3123b37e3f1fd3f10da001a8ea893c2 Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Fri, 4 Sep 2015 00:46:42 +0200 Subject: update example inline scripts --- examples/stream_modify.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'examples/stream_modify.py') 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): -- cgit v1.2.3