Merge pull request #4417 from BenLubar/crashes-2016-03-19

fix two crashes
This commit is contained in:
Barış Soner Uşaklı
2016-03-21 09:22:48 +02:00
2 changed files with 4 additions and 4 deletions

View File

@@ -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));
}
};

View File

@@ -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);