aboutsummaryrefslogtreecommitdiffstats
path: root/mitmproxy/test/test_fuzzing.py
diff options
context:
space:
mode:
authorMaximilian Hils <git@maximilianhils.com>2016-02-15 14:58:46 +0100
committerMaximilian Hils <git@maximilianhils.com>2016-02-15 14:58:46 +0100
commit33fa49277a821b9d38e8c9bf0bcf2adcfa2f6f04 (patch)
tree31914a601302579ff817504019296fd7e9e46765 /mitmproxy/test/test_fuzzing.py
parent36f34f701991b5d474c005ec45e3b66e20f326a8 (diff)
downloadmitmproxy-33fa49277a821b9d38e8c9bf0bcf2adcfa2f6f04.tar.gz
mitmproxy-33fa49277a821b9d38e8c9bf0bcf2adcfa2f6f04.tar.bz2
mitmproxy-33fa49277a821b9d38e8c9bf0bcf2adcfa2f6f04.zip
move mitmproxy
Diffstat (limited to 'mitmproxy/test/test_fuzzing.py')
-rw-r--r--mitmproxy/test/test_fuzzing.py35
1 files changed, 35 insertions, 0 deletions
diff --git a/mitmproxy/test/test_fuzzing.py b/mitmproxy/test/test_fuzzing.py
new file mode 100644
index 00000000..cec64f58
--- /dev/null
+++ b/mitmproxy/test/test_fuzzing.py
@@ -0,0 +1,35 @@
+from . import tservers
+
+"""
+ A collection of errors turned up by fuzzing. Errors are integrated here
+ after being fixed to check for regressions.
+"""
+
+
+class TestFuzzy(tservers.HTTPProxTest):
+
+ def test_idna_err(self):
+ req = r'get:"http://localhost:%s":i10,"\xc6"'
+ p = self.pathoc()
+ assert p.request(req % self.server.port).status_code == 400
+
+ def test_nullbytes(self):
+ req = r'get:"http://localhost:%s":i19,"\x00"'
+ p = self.pathoc()
+ assert p.request(req % self.server.port).status_code == 400
+
+ def test_invalid_ipv6_url(self):
+ req = 'get:"http://localhost:%s":i13,"["'
+ p = self.pathoc()
+ resp = p.request(req % self.server.port)
+ assert resp.status_code == 400
+
+ # def test_invalid_upstream(self):
+ # req = r"get:'http://localhost:%s/p/200:i10,\x27+\x27'"
+ # p = self.pathoc()
+ # assert p.request(req % self.server.port).status_code == 502
+
+ # def test_upstream_disconnect(self):
+ # req = r'200:d0'
+ # p = self.pathod(req)
+ # assert p.status_code == 502