diff --git a/app/doorboy-proxy.py b/app/doorboy-proxy.py index 26e5492..acf6f29 100755 --- a/app/doorboy-proxy.py +++ b/app/doorboy-proxy.py @@ -91,12 +91,13 @@ async def forward_swipe(request): if not key or key not in [DOORBOY_SECRET_FLOOR, DOORBOY_SECRET_WORKSHOP]: return text("Invalid token", status=401) data = request.json - doors = [] + doors = set() if key == DOORBOY_SECRET_FLOOR: - doors.extend(["backdoor, frontdoor, grounddoor"]) + doors.update(["backdoor", "frontdoor", "grounddoor"]) if key == DOORBOY_SECRET_WORKSHOP: - doors.append("workshopdoor") + doors.add("workshopdoor") if data.get("door") not in doors: + print("Door", repr(data.get("door")), "not in", doors) return text("Not allowed", 403) async with httpx.AsyncClient() as client: