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

Commit d6b7ccc

Browse files
committed
Fix to_host_port_tuple to resolve test case issues
1 parent f3505e1 commit d6b7ccc

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

hyper/common/util.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,13 @@ def to_host_port_tuple(host_port_str, default_port=80):
3131
Converts the given string containing a host and possibly a port
3232
to a tuple.
3333
"""
34+
if ']' in host_port_str:
35+
delim = ']:'
36+
else:
37+
delim = ':'
38+
3439
try:
35-
host, port = host_port_str.rsplit(':', 1)
40+
host, port = host_port_str.rsplit(delim, 1)
3641
except ValueError:
3742
host, port = host_port_str, default_port
3843
else:

0 commit comments

Comments
 (0)