diff --git a/inventory-app/api.py b/inventory-app/api.py index ebed82d..10241aa 100644 --- a/inventory-app/api.py +++ b/inventory-app/api.py @@ -15,6 +15,8 @@ def check_api_key(f): @wraps(f) def decorated_function(*args, **kwargs): request_key = request.headers.get('Authorization', False) + if not request_key: + return "nope", 403 found_key = re.search(r"Basic (.*)", request_key).group(1) if not found_key or found_key != api_key: return "nope", 403