Skip to content

Node.js based forum software built for the modern web

ability to redirect the user from anywhere

psychobunny5d43aa32126d
diff --git a/src/routes/index.js b/src/routes/index.js
index ffee5b8272..eb35860928 100644
--- a/src/routes/index.js
+++ b/src/routes/index.js
@@ -211,6 +211,10 @@ function handleErrors(app, middleware) {
return res.sendStatus(403);
}
+ if (parseInt(err.status, 10) === 302 && err.path) {
+ return res.locals.isAPI ? res.status(302).json(err) : res.redirect(err.path);
+ }
+
res.status(err.status || 500);
if (res.locals.isAPI) {