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

proxy: switching not available for ip resolver either

tests: update tests for auth and ip resolver to check that proxy magic is not set
This commit is contained in:
Ilya Kreymer 2015-12-12 22:59:32 -08:00
parent e9b11fcbf2
commit 381f350917
3 changed files with 5 additions and 4 deletions

View File

@ -123,7 +123,7 @@ class IPCacheResolver(BaseCollResolver):
@property
def supports_switching(self):
return True
return False
def _get_ip(self, env):
ip = env['REMOTE_ADDR']

View File

@ -22,6 +22,9 @@ class TestProxyHttpAuth(BaseIntegration):
assert resp.content_type == 'text/plain'
assert resp.content_length > 0
assert 'proxy_magic = ""' in resp.body
assert 'wb.js' in resp.body
# 'Simulating' proxy by settings REQUEST_URI explicitly to http:// url and no SCRIPT_NAME
# would be nice to be able to test proxy more
def test_proxy_replay(self):
@ -29,7 +32,6 @@ class TestProxyHttpAuth(BaseIntegration):
self._assert_basic_html(resp)
assert '"20140126201127"' in resp.body
assert 'wb.js' in resp.body
def test_proxy_replay_auth_filtered(self):
headers = [('Proxy-Authorization', 'Basic ' + base64.b64encode('pywb-filt-2:'))]
@ -39,7 +41,6 @@ class TestProxyHttpAuth(BaseIntegration):
self._assert_basic_html(resp)
assert '"20140126200624"' in resp.body
assert 'wb.js' in resp.body
def test_proxy_replay_auth(self):
headers = [('Proxy-Authorization', 'Basic ' + base64.b64encode('pywb'))]
@ -49,7 +50,6 @@ class TestProxyHttpAuth(BaseIntegration):
self._assert_basic_html(resp)
assert '"20140127171238"' in resp.body
assert 'wb.js' in resp.body
def test_proxy_replay_auth_no_coll(self):
headers = [('Proxy-Authorization', 'Basic ' + base64.b64encode('no-such-coll'))]

View File

@ -18,6 +18,7 @@ class TestProxyIPResolver(BaseIntegration):
assert resp.status_int == 200
assert resp.content_type == 'text/html'
assert resp.content_length > 0
assert 'proxy_magic = ""' in resp.body
def _assert_basic_text(self, resp):
assert resp.status_int == 200