diff --git a/test/test_capture_http_proxy.py b/test/test_capture_http_proxy.py index 9923077f..56d3e416 100644 --- a/test/test_capture_http_proxy.py +++ b/test/test_capture_http_proxy.py @@ -31,8 +31,8 @@ def handle_error(self, request, client_address): print(f"cls.port: {cls.port}", flush=True) - cls.proxies = {'https': 'http://localhost:' + str(cls.port), - 'http': 'http://localhost:' + str(cls.port) + cls.proxies = {'https': 'http://127.0.0.1:' + str(cls.port), + 'http': 'http://127.0.0.1:' + str(cls.port) } print(f"cls.proxies: {cls.proxies}", flush=True) @@ -57,12 +57,12 @@ def test_capture_http_proxy(self): assert response.rec_type == 'response' assert response.rec_headers['WARC-Target-URI'] == "http://example.com/test" assert response.content_stream().read().decode('utf-8') == 'Proxied: /http://example.com/test' - assert response.rec_headers['WARC-Proxy-Host'] == 'http://localhost:{0}'.format(self.port) + assert response.rec_headers['WARC-Proxy-Host'] == 'http://127.0.0.1:{0}'.format(self.port) request = next(ai) assert request.rec_type == 'request' assert request.rec_headers['WARC-Target-URI'] == "http://example.com/test" - assert request.rec_headers['WARC-Proxy-Host'] == 'http://localhost:{0}'.format(self.port) + assert request.rec_headers['WARC-Proxy-Host'] == 'http://127.0.0.1:{0}'.format(self.port) with raises(StopIteration): assert next(ai)