diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2016-06-05 11:47:52 +1200 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2016-06-05 11:47:52 +1200 |
commit | c0c45c051a6eadf34d38f1b0d3d96c6a9196f733 (patch) | |
tree | 23b037d7c9280701b1ddecee18dad8dfb5afaa91 | |
parent | 2355c29c0ef59019950da3a0410cd91bfeedb872 (diff) | |
download | mitmproxy-c0c45c051a6eadf34d38f1b0d3d96c6a9196f733.tar.gz mitmproxy-c0c45c051a6eadf34d38f1b0d3d96c6a9196f733.tar.bz2 mitmproxy-c0c45c051a6eadf34d38f1b0d3d96c6a9196f733.zip |
Fix test that may fail due to binary header data
This is just inherently not a determinisitc test. We don't use the log HTTP
interface any more, so it can just go. A more radical "solution" is inbound
shortly.
Fixes #1207
-rw-r--r-- | netlib/http/http1/read.py | 4 | ||||
-rw-r--r-- | test/pathod/test_app.py | 3 | ||||
-rw-r--r-- | test/pathod/test_pathoc.py | 2 | ||||
-rw-r--r-- | test/pathod/tutils.py | 4 |
4 files changed, 7 insertions, 6 deletions
diff --git a/netlib/http/http1/read.py b/netlib/http/http1/read.py index bf4c2f0c..a4c341fd 100644 --- a/netlib/http/http1/read.py +++ b/netlib/http/http1/read.py @@ -340,7 +340,9 @@ def _read_headers(rfile): raise ValueError() ret.append((name, value)) except ValueError: - raise exceptions.HttpSyntaxException("Invalid headers") + raise exceptions.HttpSyntaxException( + "Invalid header line: %s" % repr(line) + ) return headers.Headers(ret) diff --git a/test/pathod/test_app.py b/test/pathod/test_app.py index fbaa773c..19888c75 100644 --- a/test/pathod/test_app.py +++ b/test/pathod/test_app.py @@ -32,9 +32,6 @@ class TestApp(tutils.DaemonTests): assert self.getpath("/log/%s" % id).status_code == 200 assert self.getpath("/log/9999999").status_code == 404 - def test_log_binary(self): - assert self.get("200:h@10b=@10b:da") - def test_response_preview(self): r = self.getpath("/response_preview", params=dict(spec="200")) assert r.status_code == 200 diff --git a/test/pathod/test_pathoc.py b/test/pathod/test_pathoc.py index 6e36c4bf..18d7f672 100644 --- a/test/pathod/test_pathoc.py +++ b/test/pathod/test_pathoc.py @@ -187,7 +187,7 @@ class TestDaemon(_TestDaemon): def test_showresp_httperr(self): v = self.tval(["get:'/p/200:d20'"], showresp=True, showsummary=True) - assert "Invalid headers" in v + assert "Invalid header" in v assert "HTTP/" in v def test_explain(self): diff --git a/test/pathod/tutils.py b/test/pathod/tutils.py index b9f38d86..1a883c93 100644 --- a/test/pathod/tutils.py +++ b/test/pathod/tutils.py @@ -102,7 +102,9 @@ class DaemonTests(object): fp=logfp, ) with c.connect(): - resp = c.request("get:/p/%s" % urllib.quote(spec).encode("string_escape")) + resp = c.request( + "get:/p/%s" % urllib.quote(spec).encode("string_escape") + ) return resp def pathoc( |