From eaaa583351f27a95bb4c04827afb05a28024afd2 Mon Sep 17 00:00:00 2001 From: CodeShell <122738806+CodeShellDev@users.noreply.github.com> Date: Thu, 19 Jun 2025 17:59:22 +0200 Subject: [PATCH] fixed indentation --- app.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/app.py b/app.py index 35a0a81..0589274 100644 --- a/app.py +++ b/app.py @@ -40,7 +40,7 @@ def fillInVars(obj): for i in range(len(obj)): obj[i] = fillInVars(obj[i]) elif isinstance(obj, str): - matches = re.findall(r"\${(.*?)}", obj) + matches = re.findall(r"\${(.*?)}", obj) for match in matches: if match in VARIABLES: value = VARIABLES[match] @@ -79,17 +79,17 @@ def middlewares(): token = auth_header.split(" ", 1)[1] token = unquote(token) - if token != API_TOKEN: + if token != API_TOKEN: infoLog(f"Client failed Bearer Auth [token: {token}]") - return UnauthorizedResponse() - elif auth_header.startswith("Basic "): - try: - decoded = base64.b64decode(auth_header.split(" ", 1)[1]).decode() - username, password = decoded.split(":", 1) + return UnauthorizedResponse() + elif auth_header.startswith("Basic "): + try: + decoded = base64.b64decode(auth_header.split(" ", 1)[1]).decode() + username, password = decoded.split(":", 1) username = unquote(username) password = unquote(password) - if username != "api" or password != API_TOKEN: + if username != "api" or password != API_TOKEN: infoLog(f"Client failed Basic Auth [user: {username}, pw:{password}]") return UnauthorizedResponse() except Exception as error: