From 61d703e761e83f7084c3224157310cc4732dd690 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Mon, 24 Nov 2025 19:33:50 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20types=20for=20Python=203.8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fastapi/security/http.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fastapi/security/http.py b/fastapi/security/http.py index 299f694dc..0d1bbba3a 100644 --- a/fastapi/security/http.py +++ b/fastapi/security/http.py @@ -1,6 +1,6 @@ import binascii from base64 import b64decode -from typing import Optional +from typing import Dict, Optional from annotated_doc import Doc from fastapi.exceptions import HTTPException @@ -82,7 +82,7 @@ class HTTPBase(SecurityBase): self.scheme_name = scheme_name or self.__class__.__name__ self.auto_error = auto_error - def make_authenticate_headers(self) -> dict[str, str]: + def make_authenticate_headers(self) -> Dict[str, str]: return {"WWW-Authenticate": f"{self.model.scheme.title()}"} def make_not_authenticated_error(self) -> HTTPException: @@ -197,7 +197,7 @@ class HTTPBasic(HTTPBase): self.realm = realm self.auto_error = auto_error - def make_authenticate_headers(self) -> dict[str, str]: + def make_authenticate_headers(self) -> Dict[str, str]: if self.realm: return {"WWW-Authenticate": f'Basic realm="{self.realm}"'} return {"WWW-Authenticate": "Basic"}