mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-30 03:14:22 +00:00
Fix SSL requests with Transfer-Encoding: chunked
Add size parameter to FileLike.readline, used by read_chunked.
This commit is contained in:
parent
e67dbf6123
commit
23f7214fc3
@ -184,10 +184,14 @@ class FileLike:
|
|||||||
result += data
|
result += data
|
||||||
return result
|
return result
|
||||||
|
|
||||||
def readline(self):
|
def readline(self, size = None):
|
||||||
result = ''
|
result = ''
|
||||||
|
bytes_read = 0
|
||||||
while True:
|
while True:
|
||||||
|
if size is not None and bytes_read >= size:
|
||||||
|
break
|
||||||
ch = self.read(1)
|
ch = self.read(1)
|
||||||
|
bytes_read += 1
|
||||||
if not ch:
|
if not ch:
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user