Skip to content

Commit 3010bc8

Browse files
committed
Update requestHandlers.js
1 parent 78009fd commit 3010bc8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/requestHandlers.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ const { configuration } = require("./config");
44

55
// Our gatekeeper: Any request must pass it's tests before being allowed to continue.
66
function handleAllRequests(req, res, next) {
7-
if (!["/list", "/add", "/remove"].includes(req.path)) res.status(401).send("Unauthorized");
7+
if (!["/list", "/add", "/remove"].some((path) => req.path.includes(path)))
8+
return res.status(401).send("Unauthorized");
89

910
if (!req.body.serverKey || req.body.serverKey !== configuration.Auth.communicationKey)
1011
return res.status(403).send("Forbidden");

0 commit comments

Comments
 (0)