diff options
| author | Aldo Cortesi <aldo@nullcube.com> | 2013-03-03 21:36:19 +1300 |
|---|---|---|
| committer | Aldo Cortesi <aldo@nullcube.com> | 2013-03-03 21:39:15 +1300 |
| commit | 5a050bb6b2b1a0bf05f4cd35d87e6f1d7a2608c0 (patch) | |
| tree | bedf7b89ab92ad8de2749fb0caf4d114183b95e1 /test | |
| parent | b21a7da142625e3b47d712cd21cbd440eb48f490 (diff) | |
| download | mitmproxy-5a050bb6b2b1a0bf05f4cd35d87e6f1d7a2608c0.tar.gz mitmproxy-5a050bb6b2b1a0bf05f4cd35d87e6f1d7a2608c0.tar.bz2 mitmproxy-5a050bb6b2b1a0bf05f4cd35d87e6f1d7a2608c0.zip | |
Tighten up checks on port ranges and path character sets.
Diffstat (limited to 'test')
| -rw-r--r-- | test/test_http.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/test/test_http.py b/test/test_http.py index f7d861fd..e98a891f 100644 --- a/test/test_http.py +++ b/test/test_http.py @@ -136,6 +136,8 @@ def test_parse_http_protocol(): def test_parse_init_connect(): assert http.parse_init_connect("CONNECT host.com:443 HTTP/1.0") + assert not http.parse_init_connect("CONNECT \0host.com:443 HTTP/1.0") + assert not http.parse_init_connect("CONNECT host.com:444444 HTTP/1.0") assert not http.parse_init_connect("bogus") assert not http.parse_init_connect("GET host.com:443 HTTP/1.0") assert not http.parse_init_connect("CONNECT host.com443 HTTP/1.0") @@ -164,11 +166,10 @@ def test_parse_init_http(): assert m == "GET" assert u == "/test" assert httpversion == (1, 1) - assert not http.parse_init_http("invalid") assert not http.parse_init_http("GET invalid HTTP/1.1") assert not http.parse_init_http("GET /test foo/1.1") - + assert not http.parse_init_http("GET /test\xc0 HTTP/1.1") class TestReadHeaders: def _read(self, data, verbatim=False): |
