Skip to content
This repository was archived by the owner on Jun 25, 2025. It is now read-only.

Commit d486558

Browse files
Yannic SchröerYannic Schröer
authored andcommitted
removed authorization header check
1 parent 28efd44 commit d486558

2 files changed

Lines changed: 0 additions & 6 deletions

File tree

fastapi_auth_middleware/middleware.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,6 @@ async def authenticate(self, conn: HTTPConnection) -> Tuple[AuthCredentials, Bas
6868
if conn.url.path in self.excluded_urls:
6969
return AuthCredentials(scopes=[]), "Unauthenticated User"
7070

71-
if "Authorization" not in conn.headers:
72-
raise AuthenticationError("Authorization header missing")
73-
7471
try:
7572
if inspect.iscoroutinefunction(self.verify_header):
7673
scopes, user = await self.verify_header(conn.headers)

tests/test_middleware.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,6 @@ def client_with_scopes(self) -> TestClient:
6969
app = fastapi_app(verify_header_basic_admin_scope)
7070
return TestClient(app)
7171

72-
def test_home_fail_no_header(self, client: TestClient):
73-
assert client.get("/").status_code == 400
74-
7572
def test_home_succeed(self, client: TestClient):
7673
assert client.get("/", headers={"Authorization": "ey.."}).status_code == 200
7774

0 commit comments

Comments
 (0)