Skip to content
Myr

fixes #1826: res.redirect('toString') fails with 500

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Removed the unused map and corrected the doc comment.

authored by Michael Ficarra · committed by Michael Ficarra · parent 1e63866 · Browse files · 1 file+3 added−7 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+3 added−7 removed

  • other:+3 added−7 removed

1 file+3 added−7 removed

modified:lib/response.js+3 added-7 removed
603 unmodified lines
604605/**606 * Set the location header to `url`.607 *608 * The given `url` can also be the name of a mapped url, for609 * example by default express supports "back" which redirects608 * The given `url` can also be "back", which redirects609 * to the _Referrer_ or _Referer_ headers or "/".610 *611 * Examples:612 *
22 unmodified lines
635 var app = this.app636 , req = this.req637 , path;638640 // setup redirect map641 var map = { back: req.get('Referrer') || '/' };639 // "back" is an alias for the referrer640 if(url === 'back') url = req.get('Referrer') || '/';641643 // perform redirect644 url = map[url] || url;645642 // relative643 if (!~url.indexOf('://') && 0 != url.indexOf('//')) {644 // relative to path645 if ('.' == url[0]) {
154 unmodified lines