diff options
author | Thomas Kriechbaumer <thomas@kriechbaumer.name> | 2016-01-26 21:04:40 +0100 |
---|---|---|
committer | Thomas Kriechbaumer <thomas@kriechbaumer.name> | 2016-02-04 09:52:27 +0100 |
commit | 64978968f2383988511dc7021ecd9892f098f723 (patch) | |
tree | 0653c0a58c5bbfd997eca3ed503653890f8ae51b /libmproxy/protocol/http2.py | |
parent | 44f83b594701f9756418cf8208c30a9ba5ac4aad (diff) | |
download | mitmproxy-64978968f2383988511dc7021ecd9892f098f723.tar.gz mitmproxy-64978968f2383988511dc7021ecd9892f098f723.tar.bz2 mitmproxy-64978968f2383988511dc7021ecd9892f098f723.zip |
fix authority handling
Diffstat (limited to 'libmproxy/protocol/http2.py')
-rw-r--r-- | libmproxy/protocol/http2.py | 8 |
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 = [] |