aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_http.py
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2013-03-03 15:12:58 +1300
committerAldo Cortesi <aldo@nullcube.com>2013-03-03 15:12:58 +1300
commitb21a7da142625e3b47d712cd21cbd440eb48f490 (patch)
tree6bd660264b455d1435fe73cbaa42311792429a21 /test/test_http.py
parent7b9300743e879a8a2e35f5786b23a17261350ff9 (diff)
downloadmitmproxy-b21a7da142625e3b47d712cd21cbd440eb48f490.tar.gz
mitmproxy-b21a7da142625e3b47d712cd21cbd440eb48f490.tar.bz2
mitmproxy-b21a7da142625e3b47d712cd21cbd440eb48f490.zip
parse_url: Handle invalid IPv6 addresses
Diffstat (limited to 'test/test_http.py')
-rw-r--r--test/test_http.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/test/test_http.py b/test/test_http.py
index 061aeb22..f7d861fd 100644
--- a/test/test_http.py
+++ b/test/test_http.py
@@ -294,11 +294,14 @@ def test_parse_url():
# Invalid IDNA
assert not http.parse_url("http://\xfafoo")
+ # Invalid PATH
assert not http.parse_url("http:/\xc6/localhost:56121")
+ # Null byte in host
assert not http.parse_url("http://foo\0")
+ # Port out of range
assert not http.parse_url("http://foo:999999")
-
-
+ # Invalid IPv6 URL - see http://www.ietf.org/rfc/rfc2732.txt
+ assert not http.parse_url('http://lo[calhost')
def test_parse_http_basic_auth():
vals = ("basic", "foo", "bar")