From 6b91ea77fe7f8535f874fe36f10df8c45585b31c Mon Sep 17 00:00:00 2001 From: laxa Date: Tue, 2 Dec 2025 16:48:45 +0100 Subject: [PATCH] Fix bug in 302 redirect --- lib/request/redirecthandler.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/request/redirecthandler.py b/lib/request/redirecthandler.py index a0e58a91056..c75ee012faa 100644 --- a/lib/request/redirecthandler.py +++ b/lib/request/redirecthandler.py @@ -76,7 +76,10 @@ def http_error_302(self, req, fp, code, msg, headers): redurl = self._get_header_redirect(headers) if not conf.ignoreRedirects else None try: - content = fp.read(MAX_CONNECTION_TOTAL_SIZE) + content = fp.fp.read(MAX_CONNECTION_TOTAL_SIZE) + buffered_copy = io.BytesIO(content) + buffered_copy.seek(0) + fp.fp = buffered_copy except: # e.g. IncompleteRead content = b"" finally: