From patchwork Sun Apr 26 20:13:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: D8485: url: fix a bytes vs str crash in processing proxy headers (issue6249) From: phabricator X-Patchwork-Id: 46238 Message-Id: To: Phabricator Cc: mercurial-devel@mercurial-scm.org Date: Sun, 26 Apr 2020 20:13:20 +0000 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 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-') }