diff options
author | Youhei Sakurai <sakurai.youhei@gmail.com> | 2015-02-27 02:44:47 +0900 |
---|---|---|
committer | Youhei Sakurai <sakurai.youhei@gmail.com> | 2015-02-27 02:44:47 +0900 |
commit | 77bb0b74ed9cf156490f52a162a4d1856694db4f (patch) | |
tree | ebaf0bd2e67052e5c3e1c56783abf0265225f02c /libmproxy/protocol | |
parent | bd6c3f64c1f3102a4e91d4a964757821773781e0 (diff) | |
download | mitmproxy-77bb0b74ed9cf156490f52a162a4d1856694db4f.tar.gz mitmproxy-77bb0b74ed9cf156490f52a162a4d1856694db4f.tar.bz2 mitmproxy-77bb0b74ed9cf156490f52a162a4d1856694db4f.zip |
Maybe it should work; https://github.com/mitmproxy/mitmproxy/issues/319
Diffstat (limited to 'libmproxy/protocol')
-rw-r--r-- | libmproxy/protocol/http.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/libmproxy/protocol/http.py b/libmproxy/protocol/http.py index 046d0b42..fff2b84f 100644 --- a/libmproxy/protocol/http.py +++ b/libmproxy/protocol/http.py @@ -1332,7 +1332,12 @@ class HTTPHandler(ProtocolHandler): # incrementally: h = flow.response._assemble_head(preserve_transfer_encoding=True) self.c.client_conn.send(h) - for chunk in http.read_http_body_chunked(self.c.server_conn.rfile, + for chunk in hasattr(flow.response.stream, "__call__") and \ + flow.response.stream(http.read_http_body_chunked(self.c.server_conn.rfile, + flow.response.headers, + self.c.config.body_size_limit, flow.request.method, + flow.response.code, False, 4096)) or \ + http.read_http_body_chunked(self.c.server_conn.rfile, flow.response.headers, self.c.config.body_size_limit, flow.request.method, flow.response.code, False, 4096): |