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

Commit ea56e36

Browse files
committed
Make suggested updates to http11 and http20 constructors
1 parent a598c39 commit ea56e36

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

CONTRIBUTORS.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,4 @@ In chronological order:
3636
- Fred Thomsen (@fredthomsen)
3737

3838
- Added support for upgrade of plaintext HTTP/1.1 to plaintext HTTP/2.
39-
39+
- Added proxy support.

hyper/http11/connection.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,15 @@ def __init__(self, host, port=None, secure=None, ssl_context=None,
8484
if proxy_port is None:
8585
try:
8686
self.proxy_host, self.proxy_port = proxy_host.split(':')
87-
self.proxy_port = int(self.proxy_port)
8887
except ValueError:
8988
self.proxy_host, self.proxy_port = proxy_host, 8080
89+
else:
90+
self.proxy_port = int(self.proxy_port)
9091
else:
9192
self.proxy_host, self.proxy_port = proxy_host, proxy_port
9293
else:
9394
self.proxy_host = None
95+
self.proxy_port = None
9496

9597
#: The size of the in-memory buffer used to store data from the
9698
#: network. This is used as a performance optimisation. Increase buffer

hyper/http20/connection.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,13 +90,15 @@ def __init__(self, host, port=None, secure=None, window_manager=None, enable_pus
9090
if proxy_port is None:
9191
try:
9292
self.proxy_host, self.proxy_port = proxy_host.split(':')
93-
self.proxy_port = int(self.proxy_port)
9493
except ValueError:
9594
self.proxy_host, self.proxy_port = proxy_host, 8080
95+
else:
96+
self.proxy_port = int(self.proxy_port)
9697
else:
9798
self.proxy_host, self.proxy_port = proxy_host, proxy_port
9899
else:
99100
self.proxy_host = None
101+
self.proxy_port = None
100102

101103
#: The size of the in-memory buffer used to store data from the
102104
#: network. This is used as a performance optimisation. Increase buffer

0 commit comments

Comments
 (0)