aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMaximilian Hils <git@maximilianhils.com>2016-12-19 19:04:45 +0100
committerGitHub <noreply@github.com>2016-12-19 19:04:45 +0100
commit77cd9224f943c8d08a7b80595e194a60b8e64d3e (patch)
tree1ae09ccb748775d6121fec70670dffb0ca8928e3 /test
parentfc5783c20e86122ca687aa41b00ca29bc852cc0c (diff)
parentfbce37054fa289eb5d7a9c791db9d4a71b96ecea (diff)
downloadmitmproxy-77cd9224f943c8d08a7b80595e194a60b8e64d3e.tar.gz
mitmproxy-77cd9224f943c8d08a7b80595e194a60b8e64d3e.tar.bz2
mitmproxy-77cd9224f943c8d08a7b80595e194a60b8e64d3e.zip
Merge pull request #1880 from mhils/1877
Fix #1877
Diffstat (limited to 'test')
-rw-r--r--test/mitmproxy/net/http/test_message.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/mitmproxy/net/http/test_message.py b/test/mitmproxy/net/http/test_message.py
index 69d029d9..a001e734 100644
--- a/test/mitmproxy/net/http/test_message.py
+++ b/test/mitmproxy/net/http/test_message.py
@@ -141,6 +141,15 @@ class TestMessageContentEncoding:
assert r.headers["content-encoding"]
assert r.get_content(strict=False) == b"foo"
+ def test_utf8_as_ce(self):
+ r = tutils.tresp()
+ r.headers["content-encoding"] = "utf8"
+ r.raw_content = b"foo"
+ with tutils.raises(ValueError):
+ assert r.content
+ assert r.headers["content-encoding"]
+ assert r.get_content(strict=False) == b"foo"
+
def test_cannot_decode(self):
r = tutils.tresp()
r.encode("gzip")