# HG changeset patch # User Augie Fackler # Date 2017-10-05 18:27:21 # Node ID 528b21b853aa95ecb1dbdb46059b18740a4853ba # Parent 34fcb0f66837fc446d586280f84f9099257c3b8f request: coerce content-type to native str Again, required by WSGI. Differential Revision: https://phab.mercurial-scm.org/D969 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 .common import ( ) from .. import ( + pycompat, util, ) @@ -89,6 +90,8 @@ class wsgirequest(object): 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: