From 741b7dab6e81eea5115d5a7635b277d648c3b55d Mon Sep 17 00:00:00 2001 From: rijenkii Date: Thu, 28 Nov 2024 00:58:26 +0700 Subject: [PATCH] Fix `HTTPException.headers` type --- fastapi/exceptions.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fastapi/exceptions.py b/fastapi/exceptions.py index 44d4ada86..492c68997 100644 --- a/fastapi/exceptions.py +++ b/fastapi/exceptions.py @@ -1,4 +1,4 @@ -from typing import Any, Dict, Optional, Sequence, Type, Union +from typing import Any, Mapping, Optional, Sequence, Type, Union from pydantic import BaseModel, create_model from starlette.exceptions import HTTPException as StarletteHTTPException @@ -54,7 +54,7 @@ class HTTPException(StarletteHTTPException): ), ] = None, headers: Annotated[ - Optional[Dict[str, str]], + Optional[Mapping[str, str]], Doc( """ Any headers to send to the client in the response.