aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2012-06-10 17:10:43 +1200
committerAldo Cortesi <aldo@nullcube.com>2012-06-10 17:10:43 +1200
commitd032504b17daf9e057172afa2e36b9206db5cac1 (patch)
tree39f5e9b84fb936ea63548716904fcdd7a8df9999
parentd60fa9918bf9a074c420a4fb3b8fa26b86710d9b (diff)
downloadmitmproxy-d032504b17daf9e057172afa2e36b9206db5cac1.tar.gz
mitmproxy-d032504b17daf9e057172afa2e36b9206db5cac1.tar.bz2
mitmproxy-d032504b17daf9e057172afa2e36b9206db5cac1.zip
Fix an exception when replaying a flow with no response.
-rw-r--r--libmproxy/flow.py2
-rw-r--r--test/test_flow.py3
-rw-r--r--test/tutils.py4
3 files changed, 2 insertions, 7 deletions
diff --git a/libmproxy/flow.py b/libmproxy/flow.py
index 10e2c335..e25460b5 100644
--- a/libmproxy/flow.py
+++ b/libmproxy/flow.py
@@ -746,8 +746,6 @@ class Response(HTTPMsg):
headers["content-length"] = [str(len(content))]
else:
content = ""
- if self.request.client_conn.close:
- headers["connection"] = ["close"]
proto = "HTTP/%s.%s %s %s"%(self.httpversion[0], self.httpversion[1], self.code, str(self.msg))
data = (proto, str(headers), content)
return FMT%data
diff --git a/test/test_flow.py b/test/test_flow.py
index d220381d..59d130f7 100644
--- a/test/test_flow.py
+++ b/test/test_flow.py
@@ -835,9 +835,6 @@ class TestResponse:
resp.content = None
assert resp._assemble()
- resp.request.client_conn.close = True
- assert "connection: close" in resp._assemble()
-
resp.content = flow.CONTENT_MISSING
assert not resp._assemble()
diff --git a/test/tutils.py b/test/tutils.py
index 2d6dad1d..74ce6ce6 100644
--- a/test/tutils.py
+++ b/test/tutils.py
@@ -121,7 +121,7 @@ class ProxTest:
r = hurl.get(
"http://127.0.0.1:%s"%self.proxy.port + "/p/" + spec,
validate_cert=False,
- debug=hurl.utils.stdout_debug
+ #debug=hurl.utils.stdout_debug
)
return r
else:
@@ -129,7 +129,7 @@ class ProxTest:
self.urlbase + "/p/" + spec,
proxy=self.proxies,
validate_cert=False,
- debug=hurl.utils.stdout_debug
+ #debug=hurl.utils.stdout_debug
)
@property