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

durin42 (Augie Fackler) phabricator at mercurial-scm.org
Sun Oct 15 04:57:51 UTC 2017


durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  This lets me actually get a capabilities response from hgweb over
  http.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/hgweb/request.py

CHANGE DETAILS

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):



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


More information about the Mercurial-devel mailing list