mirror of
https://github.com/webrecorder/pywb.git
synced 2025-03-24 06:59:52 +01:00
rewrite: fix unit tests, add extra closed check for 2.6 (not sure why its needed now)
This commit is contained in:
parent
028e274b22
commit
ceeb25a899
@ -215,7 +215,8 @@ class RewriteContent:
|
|||||||
buff = first_buff
|
buff = first_buff
|
||||||
else:
|
else:
|
||||||
buff = stream.read()
|
buff = stream.read()
|
||||||
if buff:
|
if buff and (not hasattr(stream, 'closed') or
|
||||||
|
not stream.closed):
|
||||||
buff += stream.readline()
|
buff += stream.readline()
|
||||||
|
|
||||||
while buff:
|
while buff:
|
||||||
|
@ -89,9 +89,6 @@ def test_post():
|
|||||||
env = {'REQUEST_METHOD': 'POST',
|
env = {'REQUEST_METHOD': 'POST',
|
||||||
'HTTP_ORIGIN': 'http://httpbin.org',
|
'HTTP_ORIGIN': 'http://httpbin.org',
|
||||||
'HTTP_HOST': '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}
|
'wsgi.input': buff}
|
||||||
|
|
||||||
status_headers, resp_buff = get_rewritten('http://httpbin.org/post', urlrewriter, env=env)
|
status_headers, resp_buff = get_rewritten('http://httpbin.org/post', urlrewriter, env=env)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user