Skip to content
Myr

Test cases document this.

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 99c9eec · Browse files · 1 file+0 added−14 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+0 added−14 removed

  • other:+0 added−14 removed

1 file+0 added−14 removed

modified:lib/response.js-14 removed
636 unmodified lines
637 var path638639 // relative to path640 if ('.' == url[0]) {641 /*642 * Originally, req.path was used, which is rooted within the643 * application's mount point path. In these mounted applications,644 * relative redirects would fail. For example, for an application645 * nested at /foo/bear/leaf, a redirect to ./baz would result in a646 * redirect to //./baz (which most browsers will interpret as a protocol647 * token). Even if we collapse the redundant slashes, this would still648 * compute the URL as /./baz for a relative redirect within649 * /foo/bear/leaf. This comes with a few advantages, one being that650 * applications may now be mounted at several paths, and relative651 * redirects will work provided they use dotted notation. Additionally,652 * no other behaviors are affected by this change--we are only expanding653 * the functional scope of this method.654 */641 path = req.originalUrl.split('?')[0]642 url = path + ('/' == path[path.length - 1] ? '' : '/') + url;643 // relative to mount-point644 } else if ('/' != url[0]) {
112 unmodified lines