mirror of
https://github.com/fastapi/fastapi.git
synced 2026-10-24 02:39:27 -04:00
🐛 Ensure that HTTPDigest only raises an exception when auto_error is True (#2939)
Co-authored-by: svlandeg <sofie.vanlandeghem@gmail.com>
This commit is contained in:
1 parent
b021569913
commit
ccc7c8fef9
2 files changed
+9
-6
No files matched your search
@@ -413,8 +413,11 @@ class HTTPDigest(HTTPBase):
|
||||
else:
|
||||
return None
|
||||
if scheme.lower() != "digest":
|
||||
raise HTTPException(
|
||||
status_code=HTTP_403_FORBIDDEN,
|
||||
detail="Invalid authentication credentials",
|
||||
)
|
||||
if self.auto_error:
|
||||
raise HTTPException(
|
||||
status_code=HTTP_403_FORBIDDEN,
|
||||
detail="Invalid authentication credentials",
|
||||
)
|
||||
else:
|
||||
return None
|
||||
return HTTPAuthorizationCredentials(scheme=scheme, credentials=credentials)
|
||||
Reference in new issue
Block a user