diff options
author | Maximilian Hils <git@maximilianhils.com> | 2015-09-16 00:04:23 +0200 |
---|---|---|
committer | Maximilian Hils <git@maximilianhils.com> | 2015-09-16 00:04:23 +0200 |
commit | a077d8877d210562f703c23e9625e8467c81222d (patch) | |
tree | 47608f9f99d149634f6c5dcb755bdf534a096d45 /netlib/utils.py | |
parent | 11e7f476bd4bbcd6d072fa3659f628ae3a19705d (diff) | |
download | mitmproxy-a077d8877d210562f703c23e9625e8467c81222d.tar.gz mitmproxy-a077d8877d210562f703c23e9625e8467c81222d.tar.bz2 mitmproxy-a077d8877d210562f703c23e9625e8467c81222d.zip |
finish netlib.http.http1 refactor
Diffstat (limited to 'netlib/utils.py')
-rw-r--r-- | netlib/utils.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/netlib/utils.py b/netlib/utils.py index fb579cac..a86b8019 100644 --- a/netlib/utils.py +++ b/netlib/utils.py @@ -40,9 +40,9 @@ def clean_bin(s, keep_spacing=True): ) else: if keep_spacing: - keep = b"\n\r\t" + keep = (9, 10, 13) # \t, \n, \r, else: - keep = b"" + keep = () return b"".join( six.int2byte(ch) if (31 < ch < 127 or ch in keep) else b"." for ch in six.iterbytes(s) @@ -251,7 +251,7 @@ def hostport(scheme, host, port): if (port, scheme) in [(80, "http"), (443, "https")]: return host else: - return b"%s:%s" % (host, port) + return b"%s:%d" % (host, port) def unparse_url(scheme, host, port, path=""): |