We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7511d08 commit 884657dCopy full SHA for 884657d
examples/web-service/index.js
@@ -34,7 +34,7 @@ app.use('/api', function(req, res, next){
34
if (!key) return next(error(400, 'api key required'));
35
36
// key is invalid
37
- if (!~apiKeys.indexOf(key)) return next(error(401, 'invalid api key'));
+ if (apiKeys.indexOf(key) === -1) return next(error(401, 'invalid api key'))
38
39
// all good, store req.key for route access
40
req.key = key;
0 commit comments