1
0
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:
Ilya Kreymer 2014-04-09 16:44:45 -07:00
parent bfc2e63793
commit 7636c9d3f7

View File

@ -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: