Skip to content

Commit 20c9f4a

Browse files
authored
Merge pull request #3 from CodeShellDev/main
Update Dev
2 parents 978efe2 + 4afec6b commit 20c9f4a

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

app.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def fillInVars(obj):
4040
for i in range(len(obj)):
4141
obj[i] = fillInVars(obj[i])
4242
elif isinstance(obj, str):
43-
matches = re.findall(r"\${(.*?)}", obj)
43+
matches = re.findall(r"\${(.*?)}", obj)
4444
for match in matches:
4545
if match in VARIABLES:
4646
value = VARIABLES[match]
@@ -79,17 +79,17 @@ def middlewares():
7979
token = auth_header.split(" ", 1)[1]
8080

8181
token = unquote(token)
82-
if token != API_TOKEN:
82+
if token != API_TOKEN:
8383
infoLog(f"Client failed Bearer Auth [token: {token}]")
84-
return UnauthorizedResponse()
85-
elif auth_header.startswith("Basic "):
86-
try:
87-
decoded = base64.b64decode(auth_header.split(" ", 1)[1]).decode()
88-
username, password = decoded.split(":", 1)
84+
return UnauthorizedResponse()
85+
elif auth_header.startswith("Basic "):
86+
try:
87+
decoded = base64.b64decode(auth_header.split(" ", 1)[1]).decode()
88+
username, password = decoded.split(":", 1)
8989

9090
username = unquote(username)
9191
password = unquote(password)
92-
if username != "api" or password != API_TOKEN:
92+
if username != "api" or password != API_TOKEN:
9393
infoLog(f"Client failed Basic Auth [user: {username}, pw:{password}]")
9494
return UnauthorizedResponse()
9595
except Exception as error:

0 commit comments

Comments
 (0)