Skip to content

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

Improve the test_https_tunnel_without_leak_proxy_authorization_header change.

Andrey Rakhmatulline0c5c724969e
diff --git a/tests/test_proxy_connect.py b/tests/test_proxy_connect.py
index f6381b5b1..651576c2c 100644
--- a/tests/test_proxy_connect.py
+++ b/tests/test_proxy_connect.py
@@ -117,7 +117,7 @@ class ProxyConnectTestCase(TestCase):
with LogCapture() as l:
yield crawler.crawl(seed=request)
self._assert_got_response_code(200, l)
- echo = json.loads(crawler.spider.meta['responses'][0].body.decode('utf-8'))
+ echo = json.loads(crawler.spider.meta['responses'][0].text)
self.assertTrue('Proxy-Authorization' not in echo['headers'])
@pytest.mark.xfail(reason='mitmproxy gives an error for noconnect requests')