hgweb: use our forked wsgiheaders module instead of stdlib one
authorAugie Fackler <augie@google.com>
Wed, 11 Apr 2018 14:01:37 -0400
changeset 37606 da84e26d85ed
parent 37605 74e1362585c0
child 37607 e40c8494acfa
hgweb: use our forked wsgiheaders module instead of stdlib one Now we use bytes for headers, rather than native strings. Differential Revision: https://phab.mercurial-scm.org/D2854
mercurial/hgweb/request.py
--- a/mercurial/hgweb/request.py	Thu Apr 12 10:00:09 2018 -0700
+++ b/mercurial/hgweb/request.py	Wed Apr 11 14:01:37 2018 -0400
@@ -8,7 +8,6 @@
 
 from __future__ import absolute_import
 
-import wsgiref.headers as wsgiheaders
 #import wsgiref.validate
 
 from ..thirdparty import (
@@ -289,6 +288,7 @@
         if k.startswith('HTTP_'):
             headers.append((k[len('HTTP_'):].replace('_', '-'), v))
 
+    from . import wsgiheaders # avoid cycle
     headers = wsgiheaders.Headers(headers)
 
     # This is kind of a lie because the HTTP header wasn't explicitly
@@ -378,6 +378,7 @@
         self._startresponse = startresponse
 
         self.status = None
+        from . import wsgiheaders # avoid cycle
         self.headers = wsgiheaders.Headers([])
 
         self._bodybytes = None