Patchwork D1090: httppeer: extract content-type from headers using native str

login
register
mail settings
Submitter phabricator
Date Oct. 15, 2017, 1:27 p.m.
Message ID <0519967a77c5ed3620debbcfbec18ea6@localhost.localdomain>
Download mbox | patch
Permalink /patch/24947/
State Not Applicable
Headers show

Comments

phabricator - Oct. 15, 2017, 1:27 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGa288712d86d5: httppeer: extract content-type from headers using native str (authored by durin42, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D1090?vs=2770&id=2780

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

AFFECTED FILES
  mercurial/httppeer.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/httppeer.py b/mercurial/httppeer.py
--- a/mercurial/httppeer.py
+++ b/mercurial/httppeer.py
@@ -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'):