equal
deleted
inserted
replaced
125 # Ensure the slicing of path below is valid |
125 # Ensure the slicing of path below is valid |
126 if (path != self.server.prefix |
126 if (path != self.server.prefix |
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 |
133 |
140 |
134 env = {} |
141 env = {} |