Skip to content
This repository was archived by the owner on Jan 13, 2021. It is now read-only.

Commit f49b601

Browse files
committed
Handle proxy string split better
1 parent 2a460e2 commit f49b601

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

hyper/http11/connection.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,11 @@ def __init__(self, host, port=None, secure=None, ssl_context=None,
7878
self._sock = None
7979

8080
if proxy:
81-
self.proxy_host, self.proxy_port = proxy.split(':')
82-
if(self.proxy_port):
81+
if(':' in proxy):
82+
self.proxy_host, self.proxy_port = proxy.split(':')
8383
self.proxy_port = int(self.proxy_port)
8484
else:
85+
self.proxy_host = proxy
8586
self.proxy_port = 8080
8687
else:
8788
self.proxy_host = None

0 commit comments

Comments
 (0)