diff options
author | Michael Frister <michael+git@frister.net> | 2012-03-08 23:10:21 +0100 |
---|---|---|
committer | Michael Frister <michael+git@frister.net> | 2012-03-08 23:10:21 +0100 |
commit | 23f7214fc3e10d8a0cc9a61256b01fac117f77f2 (patch) | |
tree | 8744774335da5bbd136955ffbd2e098b30a88fc3 /libmproxy/proxy.py | |
parent | e67dbf61236c479acc77db1fbeb98d1c06ff9a0b (diff) | |
download | mitmproxy-23f7214fc3e10d8a0cc9a61256b01fac117f77f2.tar.gz mitmproxy-23f7214fc3e10d8a0cc9a61256b01fac117f77f2.tar.bz2 mitmproxy-23f7214fc3e10d8a0cc9a61256b01fac117f77f2.zip |
Fix SSL requests with Transfer-Encoding: chunked
Add size parameter to FileLike.readline, used by read_chunked.
Diffstat (limited to 'libmproxy/proxy.py')
-rw-r--r-- | libmproxy/proxy.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libmproxy/proxy.py b/libmproxy/proxy.py index c5833d0c..72a7a5a3 100644 --- a/libmproxy/proxy.py +++ b/libmproxy/proxy.py @@ -184,10 +184,14 @@ class FileLike: result += data return result - def readline(self): + def readline(self, size = None): result = '' + bytes_read = 0 while True: + if size is not None and bytes_read >= size: + break ch = self.read(1) + bytes_read += 1 if not ch: break else: |