···1818 && req.headers.accept
1919 && !allowedContentTypes.some(type => req.headers.accept?.includes(type))) {
2020 // Respond with a 401 if the request did not include an Accept header for a HTML response.
2121- res.sendStatus(401);
2121+ return res.sendStatus(401);
2222 }
23232424 next();