diff options
author | Maximilian Hils <git@maximilianhils.com> | 2014-07-27 03:28:23 +0200 |
---|---|---|
committer | Maximilian Hils <git@maximilianhils.com> | 2014-07-27 03:28:23 +0200 |
commit | c9be57b6828ac06e7ec105cba15560fb2c83030e (patch) | |
tree | d4351e822163bc92d1385701936c68648c5e0ff9 /test/test_protocol_http.py | |
parent | 2b31a9c49e8dab2955121a7d748f4a73837e4267 (diff) | |
download | mitmproxy-c9be57b6828ac06e7ec105cba15560fb2c83030e.tar.gz mitmproxy-c9be57b6828ac06e7ec105cba15560fb2c83030e.tar.bz2 mitmproxy-c9be57b6828ac06e7ec105cba15560fb2c83030e.zip |
fix #313
Diffstat (limited to 'test/test_protocol_http.py')
-rw-r--r-- | test/test_protocol_http.py | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/test/test_protocol_http.py b/test/test_protocol_http.py index 4026e79a..451b7b5d 100644 --- a/test/test_protocol_http.py +++ b/test/test_protocol_http.py @@ -54,7 +54,6 @@ class TestHTTPRequest: r = tutils.treq() tutils.raises("Invalid request form", r._assemble, "antiauthority") - def test_set_url(self): r = tutils.treq_absolute() r.set_url("https://otheraddress:42/ORLY") @@ -127,6 +126,21 @@ class TestProxyChainingSSL(tservers.HTTPChainProxyTest): # request from chain[1] to proxy assert self.proxy.tmaster.state.flow_count() == 1 # request from chain[0] (regular proxy doesn't store CONNECTs) + def test_closing_connect_response(self): + """ + https://github.com/mitmproxy/mitmproxy/issues/313 + """ + def handle_request(r): + r.httpversion = (1,0) + del r.headers["Content-Length"] + r.reply() + _handle_request = self.chain[0].tmaster.handle_request + self.chain[0].tmaster.handle_request = handle_request + try: + assert self.pathoc().request("get:/p/418").status_code == 418 + finally: + self.chain[0].tmaster.handle_request = _handle_request + class TestProxyChainingSSLReconnect(tservers.HTTPChainProxyTest): ssl = True |