From 81696dd24a648d23afb02fb57c22d05e5a7c85ea Mon Sep 17 00:00:00 2001
From: Peter Jaszkowiak
Date: Fri, 31 Mar 2017 14:45:03 -0600
Subject: [PATCH] Fxi #5561
---
src/controllers/errors.js | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/controllers/errors.js b/src/controllers/errors.js
index 6ab0dc6471..0e61b557cc 100644
--- a/src/controllers/errors.js
+++ b/src/controllers/errors.js
@@ -43,13 +43,14 @@ exports.handleErrors = function (err, req, res, next) { // eslint-disable-line n
return res.status(403).type('text/plain').send(err.message);
}
- if (parseInt(err.status, 10) === 302 && err.path) {
- return res.locals.isAPI ? res.status(302).json(err.path) : res.redirect(err.path);
+ var status = parseInt(err.status, 10);
+ if ((status === 302 || status === 308) && err.path) {
+ return res.locals.isAPI ? res.status(status).json(err.path) : res.redirect(err.path);
}
winston.error(req.path + '\n', err.stack);
- res.status(err.status || 500);
+ res.status(status || 500);
var path = String(req.path || '');
if (res.locals.isAPI) {