From d89f9df52e75fd50ad8cbd51e6f4b8f57f7a68c6 Mon Sep 17 00:00:00 2001 From: Paul Tremberth Date: Tue, 21 Jun 2016 17:14:41 +0200 Subject: [PATCH] Fix CONNECT request timeout (with an ugly hack) --- tests/test_downloader_handlers.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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):