Skip to content

Commit

Permalink
Add http/s prefix to proxies
Browse files Browse the repository at this point in the history
Requests no longer supports the localhost:port pattern without a
prefix, see: psf/requests#6032
  • Loading branch information
tw4l committed May 15, 2024
1 parent 7cec3d8 commit 8f99d38
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions test/test_capture_http_proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 8f99d38

Please sign in to comment.