aboutsummaryrefslogtreecommitdiffstats
path: root/libmproxy/protocol
diff options
context:
space:
mode:
authorMaximilian Hils <git@maximilianhils.com>2014-07-25 18:47:48 +0200
committerMaximilian Hils <git@maximilianhils.com>2014-07-25 18:47:48 +0200
commit4382829b7d9fde4358e12f7c9f195c7d7c854ff1 (patch)
tree2b605ec52ca3cd0ba3c6122d86ff0a808f51dd2f /libmproxy/protocol
parenta1fa34e61c4414898fd489c40d543ffe638c3d22 (diff)
downloadmitmproxy-4382829b7d9fde4358e12f7c9f195c7d7c854ff1.tar.gz
mitmproxy-4382829b7d9fde4358e12f7c9f195c7d7c854ff1.tar.bz2
mitmproxy-4382829b7d9fde4358e12f7c9f195c7d7c854ff1.zip
workaround: always make sure that flow.response.reply exists
Diffstat (limited to 'libmproxy/protocol')
-rw-r--r--libmproxy/protocol/http.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/libmproxy/protocol/http.py b/libmproxy/protocol/http.py
index 8b9cb448..cc6533b2 100644
--- a/libmproxy/protocol/http.py
+++ b/libmproxy/protocol/http.py
@@ -921,7 +921,7 @@ class HTTPHandler(ProtocolHandler, TemporaryServerChangeMixin):
flow.response = self.get_response_from_server(flow.request, include_body=False)
# call the appropriate script hook - this is an opportunity for an inline script to set flow.stream = True
- self.c.channel.ask("responseheaders", flow)
+ self.c.channel.ask("responseheaders", flow.response)
# now get the rest of the request body, if body still needs to be read but not streaming this response
if flow.response.stream:
@@ -931,8 +931,9 @@ class HTTPHandler(ProtocolHandler, TemporaryServerChangeMixin):
self.c.config.body_size_limit,
flow.request.method, flow.response.code, False)
- flow.server_conn = self.c.server_conn # no further manipulation of self.c.server_conn beyond this point
+ # no further manipulation of self.c.server_conn beyond this point
# we can safely set it as the final attribute value here.
+ flow.server_conn = self.c.server_conn
self.c.log("response", "debug", [flow.response._assemble_first_line()])
response_reply = self.c.channel.ask("response", flow.response)