From 5dafbcf80c2b663085a1a5110a32e24b0d239be0 Mon Sep 17 00:00:00 2001 From: nggit Date: Mon, 2 Feb 2026 11:12:37 +0700 Subject: [PATCH] keep response headers on redirect (30x) --- tremolo/lib/http_response.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tremolo/lib/http_response.py b/tremolo/lib/http_response.py index 80c111a..1649a9f 100644 --- a/tremolo/lib/http_response.py +++ b/tremolo/lib/http_response.py @@ -484,7 +484,9 @@ async def handle_exception(self, exc, *args, data=None): exc = HTTPException(cause=exc) if data is None: - self.headers.clear() + if exc.code >= 400: + self.headers.clear() + self.set_status(exc.code, exc.message) self.set_content_type(exc.content_type)