diff options
author | Maximilian Hils <git@maximilianhils.com> | 2015-09-26 20:07:11 +0200 |
---|---|---|
committer | Maximilian Hils <git@maximilianhils.com> | 2015-09-26 20:07:11 +0200 |
commit | 466888b01a361e46fb3d4e66afa2c6a0fd168c8e (patch) | |
tree | d7e6c6180b108318d76698883ddf17ae4cb704b0 /netlib/encoding.py | |
parent | 49ea8fc0ebcfe4861f099200044a553f092faec7 (diff) | |
download | mitmproxy-466888b01a361e46fb3d4e66afa2c6a0fd168c8e.tar.gz mitmproxy-466888b01a361e46fb3d4e66afa2c6a0fd168c8e.tar.bz2 mitmproxy-466888b01a361e46fb3d4e66afa2c6a0fd168c8e.zip |
improve request tests, coverage++
Diffstat (limited to 'netlib/encoding.py')
-rw-r--r-- | netlib/encoding.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/netlib/encoding.py b/netlib/encoding.py index 4c11273b..14479e00 100644 --- a/netlib/encoding.py +++ b/netlib/encoding.py @@ -12,6 +12,8 @@ ENCODINGS = {"identity", "gzip", "deflate"} def decode(e, content): + if not isinstance(content, bytes): + return None encoding_map = { "identity": identity, "gzip": decode_gzip, @@ -23,6 +25,8 @@ def decode(e, content): def encode(e, content): + if not isinstance(content, bytes): + return None encoding_map = { "identity": identity, "gzip": encode_gzip, |