Merge pull request #1811 from scrapy/backport-1.1-revert-pr1678

[backport][1.1] Revert "Cleanup http11 tunneling connection after #1678"
This commit is contained in:
Paul Tremberth 2016-02-24 17:53:56 +01:00
commit 6801af2419
1 changed files with 5 additions and 3 deletions

View File

@ -92,9 +92,11 @@ class TunnelingTCP4ClientEndpoint(TCP4ClientEndpoint):
def requestTunnel(self, protocol):
"""Asks the proxy to open a tunnel."""
tunnelReq = to_bytes(
'CONNECT %s:%s HTTP/1.1\r\n' % (
self._tunneledHost, self._tunneledPort), encoding='ascii')
tunnelReq = (
b'CONNECT ' +
to_bytes(self._tunneledHost, encoding='ascii') + b':' +
to_bytes(str(self._tunneledPort)) +
b' HTTP/1.1\r\n')
if self._proxyAuthHeader:
tunnelReq += \
b'Proxy-Authorization: ' + self._proxyAuthHeader + b'\r\n'