Do not initialize status code to 404 when method is OPTIONS

This commit is contained in:
Daniel García Aubert
2018-05-09 16:24:38 +02:00
parent 976ee35a35
commit 0741881959
@@ -1,6 +1,9 @@
module.exports = function initializeStatusCode () {
return function initializeStatusCodeMiddleware (req, res, next) {
res.statusCode = 404;
if (req.method !== 'OPTIONS') {
res.statusCode = 404;
}
next();
};
};