diff options
author | Aldo Cortesi <aldo@corte.si> | 2015-08-01 11:38:33 +1200 |
---|---|---|
committer | Aldo Cortesi <aldo@corte.si> | 2015-08-01 11:38:33 +1200 |
commit | c31b6c3c36f681d1dbc3ce11922741b7e1e41837 (patch) | |
tree | f63a0f56534d16437aaa5464cf585cac82f90985 /libmproxy/utils.py | |
parent | cdc84f52d213cb2b2b2a06a17378ebe757908865 (diff) | |
parent | 4f38c6b90e239d192863dee271e267b498c72206 (diff) | |
download | mitmproxy-c31b6c3c36f681d1dbc3ce11922741b7e1e41837.tar.gz mitmproxy-c31b6c3c36f681d1dbc3ce11922741b7e1e41837.tar.bz2 mitmproxy-c31b6c3c36f681d1dbc3ce11922741b7e1e41837.zip |
Merge pull request #698 from Kriechi/http2-wip
[WIP] Protocol Refactoring for HTTP/2
Diffstat (limited to 'libmproxy/utils.py')
-rw-r--r-- | libmproxy/utils.py | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/libmproxy/utils.py b/libmproxy/utils.py index a29a53f5..78f74767 100644 --- a/libmproxy/utils.py +++ b/libmproxy/utils.py @@ -8,6 +8,7 @@ import functools import cgi import json +import netlib.utils def timestamp(): """ @@ -195,21 +196,12 @@ def parse_content_type(c): return ts[0].lower(), ts[1].lower(), d -def hostport(scheme, host, port): - """ - Returns the host component, with a port specifcation if needed. - """ - if (port, scheme) in [(80, "http"), (443, "https")]: - return host - else: - return "%s:%s" % (host, port) - def unparse_url(scheme, host, port, path=""): """ Returns a URL string, constructed from the specified compnents. """ - return "%s://%s%s" % (scheme, hostport(scheme, host, port), path) + return "%s://%s%s" % (scheme, netlib.utils.hostport(scheme, host, port), path) def clean_hanging_newline(t): |