changeset 34720:60e7da55e5e6

hgweb: set sent_headers attr as early as practical While doing Python 3 porting work, I've seen exceptions happen in parts of hgweb we normally assume are robust. It won't hurt anything to set this attribute significantly earlier, so let's do so and save confusing during the porting process. Differential Revision: https://phab.mercurial-scm.org/D1085
author Augie Fackler <augie@google.com>
date Sat, 14 Oct 2017 15:37:33 -0400
parents 6e1b05692b2c
children baee5512f262
files mercurial/hgweb/server.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/hgweb/server.py	Thu Oct 05 14:53:52 2017 -0400
+++ b/mercurial/hgweb/server.py	Sat Oct 14 15:37:33 2017 -0400
@@ -115,6 +115,7 @@
         self.do_POST()
 
     def do_hgweb(self):
+        self.sent_headers = False
         path, query = _splitURI(self.path)
 
         env = {}
@@ -167,7 +168,6 @@
 
         self.saved_status = None
         self.saved_headers = []
-        self.sent_headers = False
         self.length = None
         self._chunked = None
         for chunk in self.server.application(env, self._start_response):