Patchwork D3727: hgweb: insist http_status value is a sysstr

login
register
mail settings
Submitter phabricator
Date June 13, 2018, 1:09 a.m.
Message ID <differential-rev-PHID-DREV-wvnknlauox2y25l3pvc6-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/32103/
State Superseded
Headers show

Comments

phabricator - June 13, 2018, 1:09 a.m.
durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  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.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D3727

AFFECTED FILES
  mercurial/hgweb/server.py

CHANGE DETAILS




To: durin42, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/mercurial/hgweb/server.py b/mercurial/hgweb/server.py
--- a/mercurial/hgweb/server.py
+++ b/mercurial/hgweb/server.py
@@ -215,6 +215,7 @@ 
         self.sent_headers = True
 
     def _start_response(self, http_status, headers, exc_info=None):
+        assert isinstance(http_status, str)
         code, msg = http_status.split(None, 1)
         code = int(code)
         self.saved_status = http_status