rack/rack-test

Relative redirect is not followed correctly

ioquatix opened this issue · 5 comments

According to https://tools.ietf.org/html/rfc7231#section-7.1.2 a relative location can be returned in the location header.

However, if the request for, say /foo/bar returns Location: baz, rack-test follow_redirects! generates a request for /baz, not /foo/baz like it probably should (and as supported by the RFC.

However, if the request for, say /foo/bar returns Location: baz, rack-test follow_redirects! generates a request for /baz, not /foo/baz like it probably should (and as supported by the RFC.

Thanks for letting us know! Would you be willing to submit a PR that fixes this incorrect behavior?

We can use Ruby’s stdlib URI parser

Okay I've made a PR.

Thanks :)

NP!