Skip to content

Commit

Permalink
fix: used common headers
Browse files Browse the repository at this point in the history
  • Loading branch information
iudeen committed Sep 9, 2022
1 parent f26af44 commit fda6d88
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fastapi/exception_handlers.py
Expand Up @@ -10,7 +10,7 @@
async def http_exception_handler(request: Request, exc: HTTPException) -> Response:
headers = getattr(exc, "headers", None)
if not is_body_allowed_for_status_code(exc.status_code):
return Response(status_code=exc.status_code, headers=exc.headers)
return Response(status_code=exc.status_code, headers=headers)
if headers:
return JSONResponse(
{"detail": exc.detail}, status_code=exc.status_code, headers=headers
Expand Down

0 comments on commit fda6d88

Please sign in to comment.