Skip to content

Commit 35fb630

Browse files
committed
Revert "[MRG+1] Cleanup http11 tunneling connection after scrapy#1678"
1 parent 62a5171 commit 35fb630

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)