##// END OF EJS Templates
server: always close http socket if responding with an error (issue6033)...
Augie Fackler -
r41544:197f092b 4.8.2 stable
parent child Browse files
Show More
@@ -127,6 +127,13 b' class _httprequesthandler(httpservermod.'
127 and not path.startswith(self.server.prefix + b'/')):
127 and not path.startswith(self.server.prefix + b'/')):
128 self._start_response(pycompat.strurl(common.statusmessage(404)),
128 self._start_response(pycompat.strurl(common.statusmessage(404)),
129 [])
129 [])
130 if self.command == 'POST':
131 # Paranoia: tell the client we're going to close the
132 # socket so they don't try and reuse a socket that
133 # might have a POST body waiting to confuse us. We do
134 # this by directly munging self.saved_headers because
135 # self._start_response ignores Connection headers.
136 self.saved_headers = [(r'Connection', r'Close')]
130 self._write(b"Not Found")
137 self._write(b"Not Found")
131 self._done()
138 self._done()
132 return
139 return
General Comments 0
You need to be logged in to leave comments. Login now