mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-20 07:21:13 -05:00
Make bearer prefix on auth header case insensitive
From a support ticket:
> the "Bearer" prefix on the auth header is case sensitive. Can this be
> made case-insensitive?
Sure can 🙃
This commit is contained in:
@@ -27,7 +27,7 @@ def get_auth_token(req):
|
||||
if not auth_header:
|
||||
raise AuthError('Unauthorized, authentication token must be provided', 401)
|
||||
|
||||
auth_scheme = auth_header[:7]
|
||||
auth_scheme = auth_header[:7].title()
|
||||
|
||||
if auth_scheme != 'Bearer ':
|
||||
raise AuthError('Unauthorized, authentication bearer scheme must be used', 401)
|
||||
|
||||
Reference in New Issue
Block a user