aboutsummaryrefslogtreecommitdiffstats
path: root/test/http/http1/test_read.py
diff options
context:
space:
mode:
authorMaximilian Hils <git@maximilianhils.com>2015-09-16 18:43:24 +0200
committerMaximilian Hils <git@maximilianhils.com>2015-09-16 18:43:24 +0200
commit265f31e8782ee9da511ce4b63aa2da00221cbf66 (patch)
treec0eba50b522d1d0183b057e9cae7bf7cc38c4fc3 /test/http/http1/test_read.py
parent9b882d245052feec44fc77e102dc597d24de2b80 (diff)
downloadmitmproxy-265f31e8782ee9da511ce4b63aa2da00221cbf66.tar.gz
mitmproxy-265f31e8782ee9da511ce4b63aa2da00221cbf66.tar.bz2
mitmproxy-265f31e8782ee9da511ce4b63aa2da00221cbf66.zip
adjust http1-related code
Diffstat (limited to 'test/http/http1/test_read.py')
-rw-r--r--test/http/http1/test_read.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/test/http/http1/test_read.py b/test/http/http1/test_read.py
index 5e6680af..55def2a5 100644
--- a/test/http/http1/test_read.py
+++ b/test/http/http1/test_read.py
@@ -108,14 +108,14 @@ class TestReadBody(object):
def test_connection_close():
headers = Headers()
- assert connection_close((1, 0), headers)
- assert not connection_close((1, 1), headers)
+ assert connection_close(b"HTTP/1.0", headers)
+ assert not connection_close(b"HTTP/1.1", headers)
headers["connection"] = "keep-alive"
- assert not connection_close((1, 1), headers)
+ assert not connection_close(b"HTTP/1.1", headers)
headers["connection"] = "close"
- assert connection_close((1, 1), headers)
+ assert connection_close(b"HTTP/1.1", headers)
def test_expected_http_body_size():
@@ -281,6 +281,10 @@ class TestReadHeaders(object):
with raises(HttpSyntaxException):
self._read(data)
+ def test_read_empty_name(self):
+ data = b":foo"
+ with raises(HttpSyntaxException):
+ self._read(data)
def test_read_chunked():
req = treq(body=None)