Skip to content

Commit

Permalink
fix 500 error with empty token/bearer
Browse files Browse the repository at this point in the history
  • Loading branch information
smeng9 authored and nicolaiarocci committed Feb 10, 2022
1 parent bbc9881 commit 9f081a2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion eve/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ def authorized(self, allowed_roles, resource, method):
if not auth and request.headers.get("Authorization"):
auth = request.headers.get("Authorization").strip()
if auth.lower().startswith(("token", "bearer")):
auth = auth.split(" ")[1]
auth = auth.split(" ")[1] if " " in auth else ""

if auth:
self.set_user_or_token(auth)
Expand Down

0 comments on commit 9f081a2

Please sign in to comment.