diff --git a/src/backend.ts b/src/backend.ts index 6eb3c37..3990fe0 100644 --- a/src/backend.ts +++ b/src/backend.ts @@ -79,7 +79,7 @@ export default async function init(router: Router): Promise { let id = randomString(8); while (await polls.getItem(id)) id = randomString(6); await polls.setItem(id, {}); - const dupeCheckMode = ["none", "ip", "cookie"].includes(req.body.dupeCheckMode) ? req.body.dupeCheckMode : "ip"; + const dupeCheckMode = ["none", "ip", "cookie"].includes((req.body.dupeCheckMode || "").toLowerCase()) ? (req.body.dupeCheckMode || "").toLowerCase() : "ip"; const dupeData = dupeCheckMode === "none" ? null : dupeCheckMode === "ip" ? [] :