aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYouhei Sakurai <sakurai.youhei@gmail.com>2015-02-27 03:17:40 +0900
committerYouhei Sakurai <sakurai.youhei@gmail.com>2015-02-27 03:17:40 +0900
commit1d42c1b3c4f97a9e0d08bf55580b17ce144bd723 (patch)
treefd2fcac4fce2eac5a68563f99bcc1198d57ee17b
parent77bb0b74ed9cf156490f52a162a4d1856694db4f (diff)
downloadmitmproxy-1d42c1b3c4f97a9e0d08bf55580b17ce144bd723.tar.gz
mitmproxy-1d42c1b3c4f97a9e0d08bf55580b17ce144bd723.tar.bz2
mitmproxy-1d42c1b3c4f97a9e0d08bf55580b17ce144bd723.zip
Modify example to notify incompatibility with --stream SIZE command line
option; https://github.com/mitmproxy/mitmproxy/issues/319
-rw-r--r--examples/stream_modify.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/examples/stream_modify.py b/examples/stream_modify.py
index 517f730a..a28d95c7 100644
--- a/examples/stream_modify.py
+++ b/examples/stream_modify.py
@@ -1,3 +1,10 @@
+"""
+This inline script won't work with --stream SIZE command line option.
+
+That's because flow.response.stream will be overwritten to True if the
+command line option exists.
+"""
+
def modify(chunks):
"""
chunks is a generator that can be used to iterate over all chunks.
@@ -9,3 +16,4 @@ def modify(chunks):
def responseheaders(ctx, flow):
flow.response.stream = modify
+ flow.response.stream_large_bodies = 1024 # = 1KB