diff --git a/lib/response.js b/lib/response.js index fede486c06..553766f22a 100644 --- a/lib/response.js +++ b/lib/response.js @@ -904,12 +904,7 @@ res.cookie = function (name, value, options) { */ res.location = function location(url) { - var loc = url; - - // "back" is an alias for the referrer - if (url === 'back') { - loc = this.req.get('Referrer') || '/'; - } + var loc = url === 'back' ? this.req.get('Referrer') || '/' : url; // set location return this.set('Location', encodeUrl(loc));