aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libmproxy/protocol/http2.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/libmproxy/protocol/http2.py b/libmproxy/protocol/http2.py
index 20321d53..423c5caa 100644
--- a/libmproxy/protocol/http2.py
+++ b/libmproxy/protocol/http2.py
@@ -265,12 +265,12 @@ class Http2SingleStreamLayer(_HttpTransmissionLayer, threading.Thread):
scheme, host, port, _ = utils.parse_url(path)
if authority:
- host, port = authority.split(':')
+ host, _, port = authority.partition(':')
- if host is None:
+ if not host:
host = 'localhost'
- if port is None:
- port = 80 if scheme == 'http' else 443
+ if not port:
+ port = 443 if scheme == 'https' else 80
port = int(port)
data = []