Patchwork D8485: url: fix a bytes vs str crash in processing proxy headers (issue6249)

login
register
mail settings
Submitter phabricator
Date April 26, 2020, 8:13 p.m.
Message ID <differential-rev-PHID-DREV-7jvejvtybteju6iy4byb-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/46238/
State Superseded
Headers show

Comments

phabricator - April 26, 2020, 8:13 p.m.
mharbison72 created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  I have no idea how to make a test for this, so if somebody knows, feel free to
  add one or follow up on this.  The bug reporter reported that it worked for
  them, so there may not be other hidden issues here.

REPOSITORY
  rHG Mercurial

BRANCH
  stable

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

AFFECTED FILES
  mercurial/url.py

CHANGE DETAILS




To: mharbison72, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/mercurial/url.py b/mercurial/url.py
--- a/mercurial/url.py
+++ b/mercurial/url.py
@@ -225,7 +225,7 @@ 
 
 def _generic_proxytunnel(self):
     proxyheaders = {
-        x: self.headers[x]
+        pycompat.bytestr(x): pycompat.bytestr(self.headers[x])
         for x in self.headers
         if x.lower().startswith('proxy-')
     }