From c1a108b447d49a20b90805aa50c48e80a19ce73e Mon Sep 17 00:00:00 2001 From: ivannotes Date: Fri, 1 Aug 2014 09:22:58 +0800 Subject: [PATCH] Bugfix for leaking Proxy-Authorization header to remote host when using tunneling --- scrapy/core/downloader/handlers/http11.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scrapy/core/downloader/handlers/http11.py b/scrapy/core/downloader/handlers/http11.py index b803af1dc..23cd07c51 100644 --- a/scrapy/core/downloader/handlers/http11.py +++ b/scrapy/core/downloader/handlers/http11.py @@ -166,6 +166,8 @@ class ScrapyAgent(object): url = urldefrag(request.url)[0] method = request.method headers = TxHeaders(request.headers) + if isinstance(agent, self._TunnelingAgent): + headers.removeHeader('Proxy-Authorization') bodyproducer = _RequestBodyProducer(request.body) if request.body else None start_time = time()