diff options
author | Schamper <Schamper@users.noreply.github.com> | 2016-09-06 17:00:08 +0200 |
---|---|---|
committer | Schamper <Schamper@users.noreply.github.com> | 2016-09-06 17:00:08 +0200 |
commit | 5728a1c900dc566cd9cce728266204572c486d8a (patch) | |
tree | 7a500b8db86562055a552d1564f2ff605487f8f7 /netlib/encoding.py | |
parent | 85e1539d0a93f964e9bae3e2af3a55a984cce33a (diff) | |
download | mitmproxy-5728a1c900dc566cd9cce728266204572c486d8a.tar.gz mitmproxy-5728a1c900dc566cd9cce728266204572c486d8a.tar.bz2 mitmproxy-5728a1c900dc566cd9cce728266204572c486d8a.zip |
Make 'none' synonymous to 'identity'
Diffstat (limited to 'netlib/encoding.py')
-rw-r--r-- | netlib/encoding.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/netlib/encoding.py b/netlib/encoding.py index d25af3e5..9b8b3868 100644 --- a/netlib/encoding.py +++ b/netlib/encoding.py @@ -34,7 +34,7 @@ def decode(encoded, encoding, errors='strict'): Raises: ValueError, if decoding fails. """ - if len(encoded) == 0 or encoding == "none": + if len(encoded) == 0: return encoded global _cache @@ -76,7 +76,7 @@ def encode(decoded, encoding, errors='strict'): Raises: ValueError, if encoding fails. """ - if len(decoded) == 0 or encoding == "none": + if len(decoded) == 0: return decoded global _cache @@ -162,12 +162,14 @@ def encode_deflate(content): custom_decode = { + "none": identity, "identity": identity, "gzip": decode_gzip, "deflate": decode_deflate, "br": decode_brotli, } custom_encode = { + "none": identity, "identity": identity, "gzip": encode_gzip, "deflate": encode_deflate, |