mirror of
https://github.com/webrecorder/pywb.git
synced 2025-03-15 00:03:28 +01:00
fix: when reading response, only readline() if previous read()
was non-empty
This commit is contained in:
parent
bfc2e63793
commit
7636c9d3f7
@ -204,13 +204,17 @@ class RewriteContent:
|
||||
if first_buff:
|
||||
buff = first_buff
|
||||
else:
|
||||
buff = stream.read() + stream.readline()
|
||||
buff = stream.read()
|
||||
if buff:
|
||||
buff += stream.readline()
|
||||
|
||||
while buff:
|
||||
if rewrite_func:
|
||||
buff = rewrite_func(buff)
|
||||
yield buff
|
||||
buff = stream.read() + stream.readline()
|
||||
buff = stream.read()
|
||||
if buff:
|
||||
buff += stream.readline()
|
||||
|
||||
# For adding a tail/handling final buffer
|
||||
if final_read_func:
|
||||
|
Loading…
x
Reference in New Issue
Block a user