From 884657d54665f323c236055d6e3d3e85d96e5f08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Strau=C3=9F?= <49093997+thst71@users.noreply.github.com> Date: Sun, 6 Feb 2022 16:59:17 +0100 Subject: [PATCH] examples: remove bitwise syntax for includes check closes #4814 --- examples/web-service/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/web-service/index.js b/examples/web-service/index.js index c22fea4032..a2cd2cb7f9 100644 --- a/examples/web-service/index.js +++ b/examples/web-service/index.js @@ -34,7 +34,7 @@ app.use('/api', function(req, res, next){ if (!key) return next(error(400, 'api key required')); // key is invalid - if (!~apiKeys.indexOf(key)) return next(error(401, 'invalid api key')); + if (apiKeys.indexOf(key) === -1) return next(error(401, 'invalid api key')) // all good, store req.key for route access req.key = key;