diff --git a/src/controllers/helpers.js b/src/controllers/helpers.js index 94dfe022c2..3962e2036b 100644 --- a/src/controllers/helpers.js +++ b/src/controllers/helpers.js @@ -41,7 +41,7 @@ helpers.redirect = function(res, url) { if (res.locals.isAPI) { res.status(308).json(url); } else { - res.redirect(nconf.get('relative_path') + url); + res.redirect(nconf.get('relative_path') + encodeURI(url)); } }; @@ -109,4 +109,4 @@ helpers.buildTitle = function(pageTitle) { return title; }; -module.exports = helpers; \ No newline at end of file +module.exports = helpers; diff --git a/src/middleware/render.js b/src/middleware/render.js index 2a9d0ba5d2..79911f71bd 100644 --- a/src/middleware/render.js +++ b/src/middleware/render.js @@ -13,7 +13,7 @@ module.exports = function(middleware) { req = this.req, defaultFn = function(err, str){ if (err) { - return req.next(err); + return next(err); } self.send(str); @@ -96,4 +96,4 @@ module.exports = function(middleware) { return parts.join(' '); } -}; \ No newline at end of file +};