changeset 34725:a288712d86d5

httppeer: extract content-type from headers using native str Differential Revision: https://phab.mercurial-scm.org/D1090
author Augie Fackler <augie@google.com>
date Sat, 14 Oct 2017 12:00:35 -0400
parents 9c3dcaf648ef
children daf12f69699f
files mercurial/httppeer.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/httppeer.py	Sat Oct 14 11:59:51 2017 -0400
+++ b/mercurial/httppeer.py	Sat Oct 14 12:00:35 2017 -0400
@@ -311,9 +311,9 @@
                 self.ui.warn(_('real URL is %s\n') % resp_url)
         self._url = resp_url
         try:
-            proto = resp.getheader('content-type')
+            proto = pycompat.bytesurl(resp.getheader(r'content-type', r''))
         except AttributeError:
-            proto = resp.headers.get('content-type', '')
+            proto = pycompat.bytesurl(resp.headers.get(r'content-type', r''))
 
         safeurl = util.hidepassword(self._url)
         if proto.startswith('application/hg-error'):