Patchwork D1087: hgweb: fill in content-type and content-length as native strings

login
register
mail settings
Submitter phabricator
Date Oct. 15, 2017, 1:27 p.m.
Message ID <2b17e123c57ee246624edf80823d6290@localhost.localdomain>
Download mbox | patch
Permalink /patch/24944/
State Not Applicable
Headers show

Comments

phabricator - Oct. 15, 2017, 1:27 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG95be8928d6b2: hgweb: fill in content-type and content-length as native strings (authored by durin42, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D1087?vs=2767&id=2777

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

AFFECTED FILES
  mercurial/hgweb/request.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/hgweb/request.py b/mercurial/hgweb/request.py
--- a/mercurial/hgweb/request.py
+++ b/mercurial/hgweb/request.py
@@ -93,14 +93,14 @@ 
         if not isinstance(type, str):
             type = pycompat.sysstr(type)
         if self._start_response is not None:
-            self.headers.append(('Content-Type', type))
+            self.headers.append((r'Content-Type', type))
             if filename:
                 filename = (filename.rpartition('/')[-1]
                             .replace('\\', '\\\\').replace('"', '\\"'))
                 self.headers.append(('Content-Disposition',
                                      'inline; filename="%s"' % filename))
             if body is not None:
-                self.headers.append(('Content-Length', str(len(body))))
+                self.headers.append((r'Content-Length', str(len(body))))
 
             for k, v in self.headers:
                 if not isinstance(v, str):