From 8add5f7ecd0099748f53cc3bcf16fee4ed31a07d Mon Sep 17 00:00:00 2001 From: tycrek Date: Tue, 29 Jun 2021 18:07:22 -0600 Subject: [PATCH] fixed 500 instead of 401 when auth header missing --- ass.js | 1 + 1 file changed, 1 insertion(+) diff --git a/ass.js b/ass.js index c6ac6c3..5140c85 100755 --- a/ass.js +++ b/ass.js @@ -106,6 +106,7 @@ function startup() { // Block unauthorized requests and attempt token sanitization app.post('/', (req, res, next) => { + req.headers.authorization = req.headers.authorization || ''; req.token = req.headers.authorization.replace(/[^\da-z]/gi, ''); // Strip anything that isn't a digit or ASCII letter !verify(req, users) ? res.sendStatus(CODE_UNAUTHORIZED) : next(); // skipcq: JS-0093 });