Skip to content

Scrapy, a fast high-level web crawling & scraping framework for Python.

Added a test case to ensure that passing the noconnect paramenter avoids trigerring the creation of a connect tunnel when downloading from a site with https scheme.

duendex8ada8f5f36b3
diff --git a/scrapy/tests/test_downloader_handlers.py b/scrapy/tests/test_downloader_handlers.py
index 614bac037..14a26fe33 100644
--- a/scrapy/tests/test_downloader_handlers.py
+++ b/scrapy/tests/test_downloader_handlers.py
@@ -213,6 +213,16 @@ class HttpProxyTestCase(unittest.TestCase):
request = Request('http://example.com', meta={'proxy': http_proxy})
return self.download_request(request, BaseSpider('foo')).addCallback(_test)
+ def test_download_with_proxy_https_noconnect(self):
+ def _test(response):
+ self.assertEquals(response.status, 200)
+ self.assertEquals(response.url, request.url)
+ self.assertEquals(response.body, 'https://example.com')
+
+ http_proxy = '%s?noconnect' % self.getURL('')
+ request = Request('https://example.com', meta={'proxy': http_proxy})
+ return self.download_request(request, BaseSpider('foo')).addCallback(_test)
+
def test_download_without_proxy(self):
def _test(response):
self.assertEquals(response.status, 200)