aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_pathod.py
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2012-07-23 15:03:56 +1200
committerAldo Cortesi <aldo@nullcube.com>2012-07-23 15:03:56 +1200
commit1c45f5b05c7e066c28dfd4c9d1cde3b794f8983c (patch)
tree0e0d27af2fff15469824dff159ea034956f5a986 /test/test_pathod.py
parentc7b5faf7dbaab518bbe9942f018861f738ebb2b0 (diff)
downloadmitmproxy-1c45f5b05c7e066c28dfd4c9d1cde3b794f8983c.tar.gz
mitmproxy-1c45f5b05c7e066c28dfd4c9d1cde3b794f8983c.tar.bz2
mitmproxy-1c45f5b05c7e066c28dfd4c9d1cde3b794f8983c.zip
Use policy hook to apply a size limit in pathod, add corresponding cmdline arg.
Diffstat (limited to 'test/test_pathod.py')
-rw-r--r--test/test_pathod.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/test/test_pathod.py b/test/test_pathod.py
index d917e25c..8e1e7490 100644
--- a/test/test_pathod.py
+++ b/test/test_pathod.py
@@ -46,7 +46,8 @@ class _DaemonTests:
self.d = test.Daemon(
staticdir=tutils.test_data.path("data"),
anchors=[("/anchor/.*", "202")],
- ssl = self.SSL
+ ssl = self.SSL,
+ sizelimit=1*1024*1024
)
@classmethod
@@ -73,6 +74,12 @@ class _DaemonTests:
c.settimeout(timeout)
return c.request(spec)
+ def test_sizelimit(self):
+ r = self.get("200:b@1g")
+ assert r.status_code == 800
+ l = self.d.log()[0]
+ assert "too large" in l["response"]["error"]
+
def test_preline(self):
v = self.pathoc(r"get:'/p/200':i0,'\r\n'")
assert v[1] == 200