1
0
mirror of https://github.com/webrecorder/pywb.git synced 2025-03-15 00:03:28 +01:00

rewrite: fix unit tests, add extra closed check for 2.6 (not sure why its needed now)

This commit is contained in:
Ilya Kreymer 2014-06-14 01:02:00 -07:00
parent 028e274b22
commit ceeb25a899
2 changed files with 2 additions and 4 deletions

View File

@ -215,7 +215,8 @@ class RewriteContent:
buff = first_buff
else:
buff = stream.read()
if buff:
if buff and (not hasattr(stream, 'closed') or
not stream.closed):
buff += stream.readline()
while buff:

View File

@ -89,9 +89,6 @@ def test_post():
env = {'REQUEST_METHOD': 'POST',
'HTTP_ORIGIN': 'http://httpbin.org',
'HTTP_HOST': 'httpbin.org',
'HTTP_CONNECTION': 'close',
'CONTENT_LENGTH': str(len(buff.getvalue())),
'CONTENT_TYPE': 'application/x-www-form-urlencoded',
'wsgi.input': buff}
status_headers, resp_buff = get_rewritten('http://httpbin.org/post', urlrewriter, env=env)