mirror of
https://github.com/internetarchive/warcprox.git
synced 2025-01-18 13:22:09 +01:00
failing test for correct handling of "http.client.RemoteDisconnected: Remote end closed connection without response" from remote server
This commit is contained in:
parent
b28f9b9fb7
commit
627ef5667b
2
setup.py
2
setup.py
@ -51,7 +51,7 @@ except:
|
|||||||
|
|
||||||
setuptools.setup(
|
setuptools.setup(
|
||||||
name='warcprox',
|
name='warcprox',
|
||||||
version='2.2.1b2.dev120',
|
version='2.2.1b2.dev121',
|
||||||
description='WARC writing MITM HTTP/S proxy',
|
description='WARC writing MITM HTTP/S proxy',
|
||||||
url='https://github.com/internetarchive/warcprox',
|
url='https://github.com/internetarchive/warcprox',
|
||||||
author='Noah Levitt',
|
author='Noah Levitt',
|
||||||
|
@ -237,6 +237,9 @@ class _TestHttpRequestHandler(http_server.BaseHTTPRequestHandler):
|
|||||||
raise Exception('bad path')
|
raise Exception('bad path')
|
||||||
headers = b'HTTP/1.1 200 OK\r\n' + actual_headers + b'\r\n'
|
headers = b'HTTP/1.1 200 OK\r\n' + actual_headers + b'\r\n'
|
||||||
logging.info('headers=%r payload=%r', headers, payload)
|
logging.info('headers=%r payload=%r', headers, payload)
|
||||||
|
elif self.path == '/empty-response':
|
||||||
|
headers = b''
|
||||||
|
payload = b''
|
||||||
else:
|
else:
|
||||||
payload = b'404 Not Found\n'
|
payload = b'404 Not Found\n'
|
||||||
headers = (b'HTTP/1.1 404 Not Found\r\n'
|
headers = (b'HTTP/1.1 404 Not Found\r\n'
|
||||||
@ -1643,6 +1646,18 @@ def test_long_warcprox_meta(
|
|||||||
with pytest.raises(StopIteration):
|
with pytest.raises(StopIteration):
|
||||||
next(rec_iter)
|
next(rec_iter)
|
||||||
|
|
||||||
|
def test_empty_response(
|
||||||
|
warcprox_, http_daemon, https_daemon, archiving_proxies,
|
||||||
|
playback_proxies):
|
||||||
|
|
||||||
|
url = 'http://localhost:%s/empty-response' % http_daemon.server_port
|
||||||
|
response = requests.get(url, proxies=archiving_proxies, verify=False)
|
||||||
|
assert response.status_code == 500
|
||||||
|
|
||||||
|
url = 'https://localhost:%s/empty-response' % http_daemon.server_port
|
||||||
|
response = requests.get(url, proxies=archiving_proxies, verify=False)
|
||||||
|
assert response.status_code == 500
|
||||||
|
|
||||||
def test_payload_digest(warcprox_, http_daemon):
|
def test_payload_digest(warcprox_, http_daemon):
|
||||||
'''
|
'''
|
||||||
Tests that digest is of RFC2616 "entity body"
|
Tests that digest is of RFC2616 "entity body"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user