mirror of
https://github.com/webrecorder/pywb.git
synced 2025-03-28 00:25:21 +01:00
proxy tests: test download page
This commit is contained in:
parent
822a1c03e4
commit
7ab398eba5
@ -226,7 +226,7 @@ class ProxyRouter(object):
|
|||||||
sock = socket.socket(_sock=conn)
|
sock = socket.socket(_sock=conn)
|
||||||
except Exception:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
elif env.get('gunicorn.socket'):
|
elif env.get('gunicorn.socket'): # pragma: no cover
|
||||||
sock = env['gunicorn.socket']
|
sock = env['gunicorn.socket']
|
||||||
|
|
||||||
if not sock:
|
if not sock:
|
||||||
@ -260,7 +260,8 @@ class ProxyRouter(object):
|
|||||||
certfile=certfile,
|
certfile=certfile,
|
||||||
ciphers="ALL",
|
ciphers="ALL",
|
||||||
suppress_ragged_eofs=False,
|
suppress_ragged_eofs=False,
|
||||||
ssl_version=ssl.PROTOCOL_SSLv23)
|
#ssl_version=ssl.PROTOCOL_SSLv23
|
||||||
|
)
|
||||||
env['pywb.proxy_ssl_sock'] = ssl_sock
|
env['pywb.proxy_ssl_sock'] = ssl_sock
|
||||||
|
|
||||||
buffreader = BufferedReader(ssl_sock, block_size=self.BLOCK_SIZE)
|
buffreader = BufferedReader(ssl_sock, block_size=self.BLOCK_SIZE)
|
||||||
|
@ -71,4 +71,27 @@ def test_replay_static():
|
|||||||
assert resp.status_code == 200
|
assert resp.status_code == 200
|
||||||
found = u'function init_banner' in resp.text
|
found = u'function init_banner' in resp.text
|
||||||
assert found, resp.text
|
assert found, resp.text
|
||||||
resp.close()
|
|
||||||
|
def test_replay_dl_page():
|
||||||
|
resp = requests.get('https://pywb.proxy/',
|
||||||
|
proxies=server.proxy_dict,
|
||||||
|
verify=TEST_CA_ROOT)
|
||||||
|
assert resp.status_code == 200
|
||||||
|
assert 'text/html' in resp.headers['content-type']
|
||||||
|
found = u'Download' in resp.text
|
||||||
|
assert found, resp.text
|
||||||
|
|
||||||
|
def test_dl_pem():
|
||||||
|
resp = requests.get('https://pywb.proxy/pywb-ca.pem',
|
||||||
|
proxies=server.proxy_dict,
|
||||||
|
verify=TEST_CA_ROOT)
|
||||||
|
|
||||||
|
assert resp.headers['content-type'] == 'application/x-x509-ca-cert'
|
||||||
|
|
||||||
|
def test_dl_p12():
|
||||||
|
resp = requests.get('https://pywb.proxy/pywb-ca.p12',
|
||||||
|
proxies=server.proxy_dict,
|
||||||
|
verify=TEST_CA_ROOT)
|
||||||
|
|
||||||
|
assert resp.headers['content-type'] == 'application/x-pkcs12'
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user