changeset 34514:528b21b853aa

request: coerce content-type to native str Again, required by WSGI. Differential Revision: https://phab.mercurial-scm.org/D969
author Augie Fackler <augie@google.com>
date Thu, 05 Oct 2017 14:27:21 -0400
parents 34fcb0f66837
children 8afc25e7effc
files mercurial/hgweb/request.py
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/hgweb/request.py	Thu Oct 05 14:26:09 2017 -0400
+++ b/mercurial/hgweb/request.py	Thu Oct 05 14:27:21 2017 -0400
@@ -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: