aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_protocol_http.py
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2015-06-12 16:00:16 +1200
committerAldo Cortesi <aldo@nullcube.com>2015-06-12 16:00:16 +1200
commit7890450b0c9d0cd95a2e5f507a9a8247702051be (patch)
tree8741042730f9e9a5e5eb28f99f3bf70e1e9274a8 /test/test_protocol_http.py
parentfcc15581808859b3d6670829c2d5248483660839 (diff)
downloadmitmproxy-7890450b0c9d0cd95a2e5f507a9a8247702051be.tar.gz
mitmproxy-7890450b0c9d0cd95a2e5f507a9a8247702051be.tar.bz2
mitmproxy-7890450b0c9d0cd95a2e5f507a9a8247702051be.zip
Handle invalid IDNA encoding in hostnames
Fixes #622
Diffstat (limited to 'test/test_protocol_http.py')
-rw-r--r--test/test_protocol_http.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/test_protocol_http.py b/test/test_protocol_http.py
index 884a528e..d8489d4d 100644
--- a/test/test_protocol_http.py
+++ b/test/test_protocol_http.py
@@ -142,6 +142,10 @@ class TestHTTPRequest:
assert r.pretty_host(True) is None
assert r.pretty_host(False) is None
+ # Invalid IDNA
+ r.headers["host"] = [".disqus.com"]
+ assert r.pretty_host(True) == ".disqus.com"
+
def test_get_form_for_urlencoded(self):
r = tutils.treq()
r.headers.add("content-type", "application/x-www-form-urlencoded")