From 148fe5d07a1989af959cc04036b8e83afa53698b Mon Sep 17 00:00:00 2001 From: 9qeklajc Date: Fri, 18 Sep 2026 21:28:00 +0200 Subject: [PATCH] fix: forward HTTPException headers in http_exception_handler --- routstr/core/exceptions.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/routstr/core/exceptions.py b/routstr/core/exceptions.py index 2fc34bb6..fe1a2ef3 100644 --- a/routstr/core/exceptions.py +++ b/routstr/core/exceptions.py @@ -92,7 +92,8 @@ async def http_exception_handler(request: Request, exc: Exception) -> JSONRespon content = {"detail": detail} content["request_id"] = request_id - return JSONResponse(status_code=status_code, content=content) + headers = getattr(exc, "headers", None) + return JSONResponse(status_code=status_code, content=content, headers=headers) def json_compliant(value: object) -> object: