Skip to content
Myr

Proposal to allow relative redirects for applications that have been mounted at multiple paths.

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

authored by Michael Ahlers · committed by Michael Ahlers · parent 30f9805 · Browse files · 1 file+7 added−1 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+7 added−1 removed

  • other:+7 added−1 removed

1 file+7 added−1 removed

modified:lib/response.js+7 added-1 removed
632 unmodified lines
633 url = map[url] || url;634635 // relative636 if (!~url.indexOf('://') && 0 != url.indexOf('//')) {637 /*638 * Allows relative redirects for applications mounted at multiple paths by639 * relying on the request (which can be safely assumed is valid since it640 * been satisfied) path, rather than the path "baked in" to the instance.641 */637 var path = app.path();642 //var path = app.path();643 var path = req.originalUrl.split('?')[0]644645 // relative to path646 if ('.' == url[0]) {647 url = req.path + '/' + url;
113 unmodified lines