diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2012-07-22 12:30:10 +1200 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2012-07-22 12:30:10 +1200 |
commit | 8d8ede7e265591e94f6e2db5bf79f6b85e822912 (patch) | |
tree | f047a31003cea2b43fe9caa67681dadfbc62a2d3 /test/test_pathod.py | |
parent | 7a49cdfef3d9f5eeaecf6d6c8938f0bb8da7c15d (diff) | |
download | mitmproxy-8d8ede7e265591e94f6e2db5bf79f6b85e822912.tar.gz mitmproxy-8d8ede7e265591e94f6e2db5bf79f6b85e822912.tar.bz2 mitmproxy-8d8ede7e265591e94f6e2db5bf79f6b85e822912.zip |
Handle invalid content length headers.
Diffstat (limited to 'test/test_pathod.py')
-rw-r--r-- | test/test_pathod.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/test/test_pathod.py b/test/test_pathod.py index 1484efcd..86f37f01 100644 --- a/test/test_pathod.py +++ b/test/test_pathod.py @@ -1,6 +1,6 @@ import requests from libpathod import pathod, test, version, pathoc -from netlib import tcp +from netlib import tcp, http import tutils class _TestApplication: @@ -115,6 +115,12 @@ class _DaemonTests: assert l["type"] == "error" assert "foo" in l["msg"] + def test_invalid_body(self): + tutils.raises(http.HttpError, self.pathoc, "get:/:h'content-length'='foo'") + l = self.d.log()[0] + assert l["type"] == "error" + assert "Invalid" in l["msg"] + class TestDaemon(_DaemonTests): |