From 966bbdbdf0ea3edb841fb919e77ea87f556a4c42 Mon Sep 17 00:00:00 2001 From: klemek Date: Mon, 20 Apr 2026 23:28:24 +0200 Subject: [PATCH] fix: redirects --- src/handlers.py | 2 +- tests/test_handlers.py | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/handlers.py b/src/handlers.py index 46f478d..aec25dd 100644 --- a/src/handlers.py +++ b/src/handlers.py @@ -146,7 +146,7 @@ class BaseHandler(abc.ABC, http.server.BaseHTTPRequestHandler): url, data=body, headers=headers, - allow_redirects=True, + allow_redirects=False, timeout=480, ) except Exception as e: diff --git a/tests/test_handlers.py b/tests/test_handlers.py index 50aa702..acc7014 100644 --- a/tests/test_handlers.py +++ b/tests/test_handlers.py @@ -761,7 +761,7 @@ class TestRequestHandler(BaseHandlerTestCase): "X-Forwarded-For": "127.0.0.1", "X-Forwarded-Proto": "https", }, - "allow_redirects": True, + "allow_redirects": False, "timeout": 480, }, ), @@ -804,7 +804,7 @@ class TestRequestHandler(BaseHandlerTestCase): "X-Forwarded-Proto": "https", "Content-Length": "5", }, - "allow_redirects": True, + "allow_redirects": False, "timeout": 480, }, ), @@ -845,7 +845,7 @@ class TestRequestHandler(BaseHandlerTestCase): "X-Forwarded-For": "127.0.0.1", "X-Forwarded-Proto": "https", }, - "allow_redirects": True, + "allow_redirects": False, "timeout": 480, }, ), @@ -878,7 +878,7 @@ class TestRequestHandler(BaseHandlerTestCase): "X-Forwarded-For": "127.0.0.1", "X-Forwarded-Proto": "https", }, - "allow_redirects": True, + "allow_redirects": False, "timeout": 480, }, ) as request_mock, @@ -920,7 +920,7 @@ class TestRequestHandler(BaseHandlerTestCase): "X-Forwarded-For": "127.0.0.1", "X-Forwarded-Proto": "https", }, - "allow_redirects": True, + "allow_redirects": False, "timeout": 480, }, ), @@ -959,7 +959,7 @@ class TestRequestHandler(BaseHandlerTestCase): "X-Forwarded-For": "127.0.0.1", "X-Forwarded-Proto": "https", }, - "allow_redirects": True, + "allow_redirects": False, "timeout": 480, }, ),