From 64978968f2383988511dc7021ecd9892f098f723 Mon Sep 17 00:00:00 2001 From: Thomas Kriechbaumer Date: Tue, 26 Jan 2016 21:04:40 +0100 Subject: fix authority handling --- libmproxy/protocol/http2.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'libmproxy/protocol') 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 = [] -- cgit v1.2.3