Skip to content

Commit 25c9f0f

Browse files
author
Peter Amstutz
committed
Make wes-client token header consistent with token header for downloads.
1 parent 84f283a commit 25c9f0f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

wes_service/arvados_wes.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,9 @@ def get_api(authtoken=None):
2424
if not connexion.request.headers.get('Authorization'):
2525
raise MissingAuthorization()
2626
authtoken = connexion.request.headers['Authorization']
27-
if authtoken.startswith("Bearer ") or authtoken.startswith("OAuth2 "):
28-
authtoken = authtoken[7:]
27+
if not authtoken.startswith("Bearer ") or authtoken.startswith("OAuth2 "):
28+
raise ValueError("Authorization token must start with 'Bearer '")
29+
authtoken = authtoken[7:]
2930
return arvados.api_from_config(version="v1", apiconfig={
3031
"ARVADOS_API_HOST": os.environ["ARVADOS_API_HOST"],
3132
"ARVADOS_API_TOKEN": authtoken,

0 commit comments

Comments
 (0)