Ignore casing in dupe check mode

This commit is contained in:
Wolvan 2021-12-29 14:23:34 +01:00
parent 584d0092d8
commit d383d501f1

View file

@ -79,7 +79,7 @@ export default async function init(router: Router): Promise<void> {
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" ? [] :