From 64fb5e9a1d9a2e8221839cf78e681c5fe6c969fb Mon Sep 17 00:00:00 2001 From: Ralph Bean Date: Mon, 20 Feb 2017 21:12:30 -0500 Subject: [PATCH] Be nice. Kill whitespace. --- module_build_service/auth.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module_build_service/auth.py b/module_build_service/auth.py index c717bb2f..58ebee70 100644 --- a/module_build_service/auth.py +++ b/module_build_service/auth.py @@ -89,12 +89,12 @@ def get_user(request): if not "authorization" in request.headers: raise Unauthorized("No 'authorization' header found.") - header = request.headers['authorization'] + header = request.headers['authorization'].strip() prefix = 'Bearer ' if not header.startswith(prefix): raise Unauthorized("Authorization headers must start with %r" % prefix) - token = header[len(prefix):] + token = header[len(prefix):].strip() try: data = _get_token_info(token) except Exception as e: