comparison mercurial/url.py @ 44783:a50f33f1ff24 stable

url: fix a bytes vs str crash in processing proxy headers (issue6249) 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. Differential Revision: https://phab.mercurial-scm.org/D8485
author Matt Harbison <matt_harbison@yahoo.com>
date Sun, 26 Apr 2020 14:29:47 -0400
parents e74af49aa3c9
children ff48eea4a926
comparison
equal deleted inserted replaced
44782:3d5fb6cab832 44783:a50f33f1ff24
223 h.headers = None 223 h.headers = None
224 224
225 225
226 def _generic_proxytunnel(self): 226 def _generic_proxytunnel(self):
227 proxyheaders = { 227 proxyheaders = {
228 x: self.headers[x] 228 pycompat.bytestr(x): pycompat.bytestr(self.headers[x])
229 for x in self.headers 229 for x in self.headers
230 if x.lower().startswith('proxy-') 230 if x.lower().startswith('proxy-')
231 } 231 }
232 self.send(b'CONNECT %s HTTP/1.0\r\n' % self.realhostport) 232 self.send(b'CONNECT %s HTTP/1.0\r\n' % self.realhostport)
233 for header in pycompat.iteritems(proxyheaders): 233 for header in pycompat.iteritems(proxyheaders):