Skip to content

Commit 8625129

Browse files
author
patched.codes[bot]
committed
Patched /Users/user/Documents/GitHub/example-python/main.py
1 parent 86d25c8 commit 8625129

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

main.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,12 @@
1212
session = requests.Session()
1313
proxies = {
1414
'http': 'http://test:pass@localhost:8080',
15-
'https': 'http://test:pass@localhost:8090',
15+
'https': 'https://test:pass@localhost:8090',
1616
}
1717
req = requests.Request('GET', url)
1818
prep = req.prepare()
19-
session.rebuild_proxies(prep, proxies)
19+
if 'https' in proxies and proxies['https'].startswith('https'):
20+
prep.proxies = proxies
21+
else:
22+
prep.proxies = {'https': None, 'http': proxies['http']}
23+
session.rebuild_proxies(prep, prep.proxies)

0 commit comments

Comments
 (0)