Skip to content

Commit 6cdbaf0

Browse files
committed
Stop prepending proxy with http if it is socks
Raised in #498.
1 parent 5561061 commit 6cdbaf0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

scholarly/_proxy_generator.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,11 +189,11 @@ def _use_proxy(self, http: str, https: str = None) -> bool:
189189
:returns: whether or not the proxy was set up successfully
190190
:rtype: {bool}
191191
"""
192-
if http[:4] != "http":
192+
if http[:4] not in ("http", "sock"):
193193
http = "http://" + http
194194
if https is None:
195195
https = http
196-
elif https[:5] != "https":
196+
elif https[:5] not in ("https", "socks"):
197197
https = "https://" + https
198198

199199
proxies = {'http://': http, 'https://': https}

0 commit comments

Comments
 (0)