mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-27 02:24:18 +00:00
attempt to fix https://github.com/mitmproxy/netlib/issues/24
This commit is contained in:
parent
38a1135ab8
commit
d4c3b1c213
@ -258,13 +258,13 @@ class ProxyHandler(tcp.BaseHandler):
|
|||||||
else:
|
else:
|
||||||
response = response_reply
|
response = response_reply
|
||||||
self.send_response(response)
|
self.send_response(response)
|
||||||
if request and http.request_connection_close(request.httpversion, request.headers):
|
if request and http.connection_close(request.httpversion, request.headers):
|
||||||
return
|
return
|
||||||
# We could keep the client connection when the server
|
# We could keep the client connection when the server
|
||||||
# connection needs to go away. However, we want to mimic
|
# connection needs to go away. However, we want to mimic
|
||||||
# behaviour as closely as possible to the client, so we
|
# behaviour as closely as possible to the client, so we
|
||||||
# disconnect.
|
# disconnect.
|
||||||
if http.response_connection_close(response.httpversion, response.headers):
|
if http.connection_close(response.httpversion, response.headers):
|
||||||
return
|
return
|
||||||
except (IOError, ProxyError, http.HttpError, tcp.NetLibError), e:
|
except (IOError, ProxyError, http.HttpError, tcp.NetLibError), e:
|
||||||
if hasattr(e, "code"):
|
if hasattr(e, "code"):
|
||||||
|
Loading…
Reference in New Issue
Block a user