]> git.ipfire.org Git - thirdparty/fastapi/fastapi.git/commitdiff
✨ Replace `dict` by `Mapping` on `HTTPException.headers` (#12997)
authorrijenkii <me@rijenkii.tk>
Tue, 10 Feb 2026 10:52:24 +0000 (17:52 +0700)
committerGitHub <noreply@github.com>
Tue, 10 Feb 2026 10:52:24 +0000 (11:52 +0100)
Co-authored-by: Alejandra <90076947+alejsdev@users.noreply.github.com>
Co-authored-by: Motov Yurii <109919500+YuriiMotov@users.noreply.github.com>
Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
fastapi/exceptions.py

index 62b4674de304e6634b49e76354ccdab8b8b91ab8..9924d0e2bdf29662858eece0b219c3443e47d85b 100644 (file)
@@ -1,4 +1,4 @@
-from collections.abc import Sequence
+from collections.abc import Mapping, Sequence
 from typing import Annotated, Any, Optional, TypedDict, Union
 
 from annotated_doc import Doc
@@ -68,7 +68,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.