From b95f0c997127bb0516cde0609c83c7d2af5ccfbc Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Mon, 8 Dec 2014 17:17:37 +0100 Subject: fix #411 --- libmproxy/protocol/http.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libmproxy/protocol/http.py b/libmproxy/protocol/http.py index 87af8e6d..49f5e8c0 100644 --- a/libmproxy/protocol/http.py +++ b/libmproxy/protocol/http.py @@ -1043,7 +1043,7 @@ class HTTPHandler(ProtocolHandler): # call the appropriate script hook - this is an opportunity for an # inline script to set flow.stream = True flow = self.c.channel.ask("responseheaders", flow) - if flow == KILL: + if flow is None or flow == KILL: raise KillSignal() else: # now get the rest of the request body, if body still needs to be @@ -1086,11 +1086,11 @@ class HTTPHandler(ProtocolHandler): # sent through to the Master. flow.request = req request_reply = self.c.channel.ask("request", flow) - self.process_server_address(flow) # The inline script may have changed request.host - if request_reply is None or request_reply == KILL: raise KillSignal() + self.process_server_address(flow) # The inline script may have changed request.host + if isinstance(request_reply, HTTPResponse): flow.response = request_reply else: -- cgit v1.2.3