aboutsummaryrefslogtreecommitdiffstats
path: root/test/mitmproxy/net/http
diff options
context:
space:
mode:
authorMaximilian Hils <git@maximilianhils.com>2016-12-19 16:06:18 +0100
committerMaximilian Hils <git@maximilianhils.com>2016-12-19 16:10:41 +0100
commitfbce37054fa289eb5d7a9c791db9d4a71b96ecea (patch)
tree39b65869d206da05f31efc311b0756c18980a589 /test/mitmproxy/net/http
parentcbc0d3fd410f50508fdd7b4cb05bac8f6a18a3a4 (diff)
downloadmitmproxy-fbce37054fa289eb5d7a9c791db9d4a71b96ecea.tar.gz
mitmproxy-fbce37054fa289eb5d7a9c791db9d4a71b96ecea.tar.bz2
mitmproxy-fbce37054fa289eb5d7a9c791db9d4a71b96ecea.zip
fix #1877
Diffstat (limited to 'test/mitmproxy/net/http')
-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")