From a9c7f8b26d10aead103d9b65f5f58eb0217989d5 Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 8 Jul 2014 14:37:44 +0800 Subject: [PATCH] Using CRLF as line marker according to http 1.1 definition --- scrapy/core/downloader/handlers/http11.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/scrapy/core/downloader/handlers/http11.py b/scrapy/core/downloader/handlers/http11.py index 52eb35eba..617a68ea4 100644 --- a/scrapy/core/downloader/handlers/http11.py +++ b/scrapy/core/downloader/handlers/http11.py @@ -66,12 +66,11 @@ class TunnelingTCP4ClientEndpoint(TCP4ClientEndpoint): def requestTunnel(self, protocol): """Asks the proxy to open a tunnel.""" - tunnelReq = 'CONNECT %s:%s HTTP/1.1\n' % (self._tunneledHost, + tunnelReq = 'CONNECT %s:%s HTTP/1.1\r\n' % (self._tunneledHost, self._tunneledPort) if self._proxyAuthHeader: - tunnelReq += 'Proxy-Authorization: %s \n\n' % self._proxyAuthHeader - else: - tunnelReq += '\n' + tunnelReq += 'Proxy-Authorization: %s\r\n' % self._proxyAuthHeader + tunnelReq += '\r\n' protocol.transport.write(tunnelReq) self._protocolDataReceived = protocol.dataReceived protocol.dataReceived = self.processProxyResponse