Skip to content

Commit 329a77a

Browse files
committed
Merge pull request scrapy#1808 from scrapy/revert-1701-cleanup-http11-tunneling
Revert "Cleanup http11 tunneling connection after scrapy#1678"
2 parents 10bcdb4 + 35fb630 commit 329a77a

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

scrapy/core/downloader/handlers/http11.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,11 @@ def __init__(self, reactor, host, port, proxyConf, contextFactory,
9292

9393
def requestTunnel(self, protocol):
9494
"""Asks the proxy to open a tunnel."""
95-
tunnelReq = to_bytes(
96-
'CONNECT %s:%s HTTP/1.1\r\n' % (
97-
self._tunneledHost, self._tunneledPort), encoding='ascii')
95+
tunnelReq = (
96+
b'CONNECT ' +
97+
to_bytes(self._tunneledHost, encoding='ascii') + b':' +
98+
to_bytes(str(self._tunneledPort)) +
99+
b' HTTP/1.1\r\n')
98100
if self._proxyAuthHeader:
99101
tunnelReq += \
100102
b'Proxy-Authorization: ' + self._proxyAuthHeader + b'\r\n'

0 commit comments

Comments
 (0)