diff --git a/lib/response.js b/lib/response.js index dfb495f..aa42306 100644 --- a/lib/response.js +++ b/lib/response.js @@ -210,8 +210,11 @@ module.exports = { */ redirect: function(url, alt){ + // location if ('back' == url) url = this.ctx.get('Referrer') || alt || '/'; this.set('Location', url); + + // status if (!status.redirect[this.status]) this.status = 302; // html