Skip to content

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

Fix CONNECT request timeout (with an ugly hack)

Paul Tremberth6539277f995b
diff --git a/tests/test_downloader_handlers.py b/tests/test_downloader_handlers.py
index 45a806f2e..c63c64d86 100644
--- a/tests/test_downloader_handlers.py
+++ b/tests/test_downloader_handlers.py
@@ -401,7 +401,13 @@ class UriResource(resource.Resource):
return self
def render(self, request):
- return request.uri
+ # Note: this is an ugly hack for CONNECT request timeout test.
+ # Returning some data here fail SSL/TLS handshake
+ # ToDo: implement proper HTTPS proxy tests, not faking them.
+ if request.method != b'CONNECT':
+ return request.uri
+ else:
+ return b''
class HttpProxyTestCase(unittest.TestCase):