diff options
author | Maximilian Hils <git@maximilianhils.com> | 2016-09-21 19:21:32 -0700 |
---|---|---|
committer | Maximilian Hils <git@maximilianhils.com> | 2016-09-21 19:21:32 -0700 |
commit | 770936f1f9b56010011c2af7f5f854d88f1c1d4f (patch) | |
tree | ff67e18d3cd927a4f08b4be79b41d9c3033d52b3 /netlib/http | |
parent | 1e5a5b03f8d56df62a04a368bd5eb2d59cb7582a (diff) | |
download | mitmproxy-770936f1f9b56010011c2af7f5f854d88f1c1d4f.tar.gz mitmproxy-770936f1f9b56010011c2af7f5f854d88f1c1d4f.tar.bz2 mitmproxy-770936f1f9b56010011c2af7f5f854d88f1c1d4f.zip |
raise TypeError on invalid header assignment, fix #1562
Diffstat (limited to 'netlib/http')
-rw-r--r-- | netlib/http/headers.py | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/netlib/http/headers.py b/netlib/http/headers.py index 131e8ce5..b55874ca 100644 --- a/netlib/http/headers.py +++ b/netlib/http/headers.py @@ -14,6 +14,7 @@ if six.PY2: # pragma: no cover return x def _always_bytes(x): + strutils.always_bytes(x, "utf-8", "replace") # raises a TypeError if x != str/bytes/None. return x else: # While headers _should_ be ASCII, it's not uncommon for certain headers to be utf-8 encoded. |