Zveinn <[email protected]> added the comment:
def _tunnel(self):
connect_str = "CONNECT %s:%d HTTP/1.0\r\n" % (self._tunnel_host,
self._tunnel_port)
connect_bytes = connect_str.encode("ascii") <<!!-- ASCII
self.send(connect_bytes)
for header, value in self._tunnel_headers.items():
header_str = "%s: %s\r\n" % (header, value)
header_bytes = header_str.encode("latin-1") <<!!-- LATIN-1
self.send(header_bytes)
self.send(b'\r\n')
Is it possible that the method was designed this way so that the header could
be encoded with latin-1 while the connect part is encoded in ascii ? Is that
needed ?
----------
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue43332>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com