diff --git a/fastapi/security/http.py b/fastapi/security/http.py index ffd2ee1ad..a8ddf0c16 100644 --- a/fastapi/security/http.py +++ b/fastapi/security/http.py @@ -118,13 +118,10 @@ class HTTPBasic(HTTPBase): self.realm = realm # keep for OpenAPI compatibility self.auto_error = auto_error - def make_authenticate_headers(self) -> dict[str, str]: - # FastAPI behavior: do NOT include realm in header - return {"WWW-Authenticate": "Basic"} - def make_authenticate_headers(self) -> dict[str, str]: return {"WWW-Authenticate": "Basic"} + async def __call__( # type: ignore self, request: Request