Message387745
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 ? |
|
Date |
User |
Action |
Args |
2021-02-26 20:38:30 | zveinn | set | recipients:
+ zveinn |
2021-02-26 20:38:30 | zveinn | set | messageid: <1614371910.37.0.961874820267.issue43332@roundup.psfhosted.org> |
2021-02-26 20:38:30 | zveinn | link | issue43332 messages |
2021-02-26 20:38:30 | zveinn | create | |
|