From 8f99d38e55fbe737ef9f23add6493ca3d9163fd4 Mon Sep 17 00:00:00 2001 From: Tessa Walsh Date: Wed, 15 May 2024 11:25:30 -0400 Subject: [PATCH] Add http/s prefix to proxies Requests no longer supports the localhost:port pattern without a prefix, see: https://github.com/psf/requests/issues/6032 --- test/test_capture_http_proxy.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/test/test_capture_http_proxy.py b/test/test_capture_http_proxy.py index b3d3e8ac..f0741603 100644 --- a/test/test_capture_http_proxy.py +++ b/test/test_capture_http_proxy.py @@ -29,13 +29,10 @@ def handle_error(self, request, client_address): server = make_server('localhost', 0, wsgiprox, server_class=NoLogServer) addr, cls.port = server.socket.getsockname() - print(f"cls.port: {cls.port}", flush=True) - - cls.proxies = {'https': 'localhost:' + str(cls.port), - 'http': 'localhost:' + str(cls.port) - } - - print(f"cls.proxies: {cls.proxies}", flush=True) + cls.proxies = { + 'https': 'https://localhost:' + str(cls.port), + 'http': 'http://localhost:' + str(cls.port), + } def run(): try: