Patchwork D3250: hgweb: use native strings when interfacing with stdlib headers

login
register
mail settings
Submitter phabricator
Date April 12, 2018, 3:34 p.m.
Message ID <cd9001fb998a201a5c2f16863c103b48@localhost.localdomain>
Download mbox | patch
Permalink /patch/30800/
State Not Applicable
Headers show

Comments

phabricator - April 12, 2018, 3:34 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGb5ca5d34fe8d: hgweb: use native strings when interfacing with stdlib headers (authored by durin42, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D3250?vs=8016&id=8069

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

AFFECTED FILES
  mercurial/hgweb/server.py

CHANGE DETAILS




To: durin42, #hg-reviewers, indygreg
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
@@ -139,17 +139,17 @@ 
                 env[r'CONTENT_TYPE'] = self.headers.get_default_type()
             else:
                 env[r'CONTENT_TYPE'] = self.headers.get_content_type()
-            length = self.headers.get('content-length')
+            length = self.headers.get(r'content-length')
         else:
             if self.headers.typeheader is None:
                 env[r'CONTENT_TYPE'] = self.headers.type
             else:
                 env[r'CONTENT_TYPE'] = self.headers.typeheader
-            length = self.headers.getheader('content-length')
+            length = self.headers.getheader(r'content-length')
         if length:
             env[r'CONTENT_LENGTH'] = length
         for header in [h for h in self.headers.keys()
-                       if h not in ('content-type', 'content-length')]:
+                       if h not in (r'content-type', r'content-length')]:
             hkey = r'HTTP_' + header.replace(r'-', r'_').upper()
             hval = self.headers.get(header)
             hval = hval.replace(r'\n', r'').strip()