diff --git a/eve/auth.py b/eve/auth.py index 25a43da95..bb63dca0f 100644 --- a/eve/auth.py +++ b/eve/auth.py @@ -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)