hgweb: put response headers back into str for Python 3
authorAugie Fackler <augie@google.com>
Wed, 11 Apr 2018 16:09:23 -0400
changeset 37589 e320d9405bba
parent 37588 165a77f7ec13
child 37590 9170df9106a8
hgweb: put response headers back into str for Python 3 This fixes a lot of hanging tests on Python 3, because "Content-Length" was getting sent as "b'Content-Length'" (yes, really) and then clients would expect a close-is-end body instead of counting off a certain number of bytes. Differential Revision: https://phab.mercurial-scm.org/D3248
mercurial/hgweb/request.py
--- a/mercurial/hgweb/request.py	Wed Apr 11 14:57:11 2018 -0400
+++ b/mercurial/hgweb/request.py	Wed Apr 11 16:09:23 2018 -0400
@@ -518,8 +518,10 @@
                 if not chunk:
                     break
 
+        strheaders = [(pycompat.strurl(k), pycompat.strurl(v)) for
+                      k, v in self.headers.items()]
         write = self._startresponse(pycompat.sysstr(self.status),
-                                    self.headers.items())
+                                    strheaders)
 
         if self._bodybytes:
             yield self._bodybytes