Py3: pathoc should send bytes over wire

This commit is contained in:
Shadab Zafar 2016-06-16 18:13:36 +05:30 committed by Maximilian Hils
parent 500bf18023
commit cd5ef042bb
2 changed files with 5 additions and 5 deletions

View File

@ -241,8 +241,8 @@ class Pathoc(tcp.TCPClient):
def http_connect(self, connect_to):
self.wfile.write(
'CONNECT %s:%s HTTP/1.1\r\n' % tuple(connect_to) +
'\r\n'
b'CONNECT %s:%d HTTP/1.1\r\n' % (connect_to[0].encode(), connect_to[1]) +
b'\r\n'
)
self.wfile.flush()
try:

View File

@ -17,9 +17,9 @@ class HTTPProtocol(object):
"""
self.pathod_handler.wfile.write(
'HTTP/1.1 200 Connection established\r\n' +
('Proxy-agent: %s\r\n' % version.PATHOD) +
'\r\n'
b'HTTP/1.1 200 Connection established\r\n' +
(b'Proxy-agent: %s\r\n' % version.PATHOD.encode()) +
b'\r\n'
)
self.pathod_handler.wfile.flush()
if not self.pathod_handler.server.ssloptions.not_after_connect: