From cc24fe2a1dc65914cec3d39ca49ba91ee61c32d1 Mon Sep 17 00:00:00 2001 From: Jonathan Lacson Date: Tue, 4 Aug 2020 16:49:08 -0400 Subject: [PATCH] Manually set URL for IDOR test to workaround newer urllib3/requests versions --- tests/server_unit_test_pserv.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/server_unit_test_pserv.py b/tests/server_unit_test_pserv.py index 6773a6d..4ff8fe6 100755 --- a/tests/server_unit_test_pserv.py +++ b/tests/server_unit_test_pserv.py @@ -1419,7 +1419,11 @@ class Access_Control(Doc_Print_Test_Case): try: # prevent path segment normalization req = requests.Request('GET', url) - response = self.session.send(req.prepare(), timeout=2) + prepared_req = req.prepare() + # set the URL manually in case newer requests/urllib3 normalizes URL + # in prepare() function + prepared_req.url = url + response = self.session.send(prepared_req, timeout=2) except requests.exceptions.RequestException: raise AssertionError("The server did not respond within 2s")