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

Commit 3b0ac19

Browse files
committed
Make changes specified in code review
1 parent b6f3060 commit 3b0ac19

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

hyper/cli.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,7 @@ def make_troubleshooting_argument(parser):
114114
def set_url_info(args):
115115
def split_host_and_port(hostname):
116116
if ':' in hostname:
117-
host, port = to_host_port_tuple(hostname)
118-
return host, port
117+
return to_host_port_tuple(hostname, default_port=443)
119118
return hostname, None
120119

121120
class UrlInfo(object):

hyper/common/util.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,18 @@ def to_host_port_tuple(host_port_str, default_port=80):
3333
Converts the given string containing a host and possibly a port
3434
to a tuple.
3535
"""
36-
uri = URIReference(scheme=None,
37-
authority=host_port_str,
38-
path=None,
39-
query=None,
40-
fragment=None)
36+
uri = URIReference(
37+
scheme=None,
38+
authority=host_port_str,
39+
path=None,
40+
query=None,
41+
fragment=None
42+
)
4143

4244
host = uri.host.strip('[]')
4345
if not uri.port:
4446
port = default_port
4547
else:
4648
port = int(uri.port)
4749

48-
return ((host, port))
50+
return (host, port)

hyper/http11/connection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class HTTP11Connection(object):
5656
def __init__(self, host, port=None, secure=None, ssl_context=None,
5757
proxy_host=None, proxy_port=None, **kwargs):
5858
if port is None:
59-
self.host, self.port = to_host_port_tuple(host)
59+
self.host, self.port = to_host_port_tuple(host, default_port=80)
6060
else:
6161
self.host, self.port = host, port
6262

0 commit comments

Comments
 (0)