aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/mitmproxy/net/http/http1/test_assemble.py12
-rw-r--r--test/mitmproxy/net/http/http1/test_read.py5
2 files changed, 5 insertions, 12 deletions
diff --git a/test/mitmproxy/net/http/http1/test_assemble.py b/test/mitmproxy/net/http/http1/test_assemble.py
index ab177885..4b4ab414 100644
--- a/test/mitmproxy/net/http/http1/test_assemble.py
+++ b/test/mitmproxy/net/http/http1/test_assemble.py
@@ -15,7 +15,6 @@ def test_assemble_request():
b"GET /path HTTP/1.1\r\n"
b"header: qvalue\r\n"
b"content-length: 7\r\n"
- b"host: address:22\r\n"
b"\r\n"
b"content"
)
@@ -84,17 +83,6 @@ def test_assemble_request_headers():
assert b"Transfer-Encoding" in c
-def test_assemble_request_headers_host_header():
- r = treq()
- r.headers = Headers()
- c = _assemble_request_headers(r.data)
- assert b"host" in c
-
- r.host = None
- c = _assemble_request_headers(r.data)
- assert b"host" not in c
-
-
def test_assemble_response_headers():
# https://github.com/mitmproxy/mitmproxy/issues/186
r = tresp(content=b"")
diff --git a/test/mitmproxy/net/http/http1/test_read.py b/test/mitmproxy/net/http/http1/test_read.py
index 4084c360..127f75ba 100644
--- a/test/mitmproxy/net/http/http1/test_read.py
+++ b/test/mitmproxy/net/http/http1/test_read.py
@@ -163,6 +163,11 @@ def test_expected_http_body_size():
assert expected_http_body_size(
treq(headers=Headers(expect="100-continue", content_length="42"))
) == 0
+ # Expect: 100-continue
+ assert expected_http_body_size(
+ treq(headers=Headers(expect="100-continue", content_length="42")),
+ expect_continue_as_0=False
+ ) == 42
# http://tools.ietf.org/html/rfc7230#section-3.3
assert expected_http_body_size(