comparison mercurial/hgweb/server.py @ 38298:af0e88e64ede

hgweb: insist http_status value is a sysstr My previous change was extremely confusing to figure out, because I thought I was looking at a client-side problem. For the low cost of an isinstance assert, we can make those errors not happen in the future. Differential Revision: https://phab.mercurial-scm.org/D3727
author Augie Fackler <augie@google.com>
date Tue, 12 Jun 2018 20:43:56 -0400
parents 9f499d28efb4
children b263133eeb5a
comparison
equal deleted inserted replaced
38297:9f499d28efb4 38298:af0e88e64ede
213 self.send_header(r'Connection', r'close') 213 self.send_header(r'Connection', r'close')
214 self.end_headers() 214 self.end_headers()
215 self.sent_headers = True 215 self.sent_headers = True
216 216
217 def _start_response(self, http_status, headers, exc_info=None): 217 def _start_response(self, http_status, headers, exc_info=None):
218 assert isinstance(http_status, str)
218 code, msg = http_status.split(None, 1) 219 code, msg = http_status.split(None, 1)
219 code = int(code) 220 code = int(code)
220 self.saved_status = http_status 221 self.saved_status = http_status
221 bad_headers = ('connection', 'transfer-encoding') 222 bad_headers = ('connection', 'transfer-encoding')
222 self.saved_headers = [h for h in headers 223 self.saved_headers = [h for h in headers