D969: request: coerce content-type to native str

durin42 (Augie Fackler) phabricator at mercurial-scm.org
Sun Oct 8 04:38:04 EDT 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rHGfc21a3513062: request: coerce content-type to native str (authored by durin42, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D969?vs=2485&id=2530

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

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
@@ -19,6 +19,7 @@
 )
 
 from .. import (
+    pycompat,
     util,
 )
 
@@ -89,6 +90,8 @@
             pass
 
     def respond(self, status, type, filename=None, body=None):
+        if not isinstance(type, str):
+            type = pycompat.sysstr(type)
         if self._start_response is not None:
             self.headers.append(('Content-Type', type))
             if filename:



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


More information about the Mercurial-devel mailing list