diff options
author | Maximilian Hils <git@maximilianhils.com> | 2015-04-10 14:59:38 +0200 |
---|---|---|
committer | Maximilian Hils <git@maximilianhils.com> | 2015-04-10 14:59:38 +0200 |
commit | 6852eb9d0af5cf7196da5cad2ccf3b036e348226 (patch) | |
tree | 7c892af020a728ee86c791954362ba1aa55ab2b7 /test/test_protocol_http.py | |
parent | f37efecd0a22313eacad33251512ef371557fde7 (diff) | |
download | mitmproxy-6852eb9d0af5cf7196da5cad2ccf3b036e348226.tar.gz mitmproxy-6852eb9d0af5cf7196da5cad2ccf3b036e348226.tar.bz2 mitmproxy-6852eb9d0af5cf7196da5cad2ccf3b036e348226.zip |
fix #553
Diffstat (limited to 'test/test_protocol_http.py')
-rw-r--r-- | test/test_protocol_http.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/test_protocol_http.py b/test/test_protocol_http.py index 23c3f469..c6fad508 100644 --- a/test/test_protocol_http.py +++ b/test/test_protocol_http.py @@ -55,6 +55,14 @@ class TestHTTPRequest: r.update_host_header() assert "Host" in r.headers + def test_expect_header(self): + s = StringIO("GET / HTTP/1.1\r\nContent-Length: 3\r\nExpect: 100-continue\r\n\r\nfoobar") + w = StringIO() + r = HTTPRequest.from_stream(s, wfile=w) + assert w.getvalue() == "HTTP/1.1 100 Continue\r\n\r\n" + assert r.content == "foo" + assert s.read(3) == "bar" + def test_authority_form_in(self): s = StringIO("CONNECT oops-no-port.com HTTP/1.1") tutils.raises("Bad HTTP request line", HTTPRequest.from_stream, s) |