Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fail to redirect to different host #131

Closed
JGAntunes opened this issue May 26, 2016 · 0 comments · Fixed by #142
Closed

Fail to redirect to different host #131

JGAntunes opened this issue May 26, 2016 · 0 comments · Fixed by #142
Assignees
Labels
bug
Milestone

Comments

@JGAntunes
Copy link
Contributor

@JGAntunes JGAntunes commented May 26, 2016

Making a request that returns a redirect code will fail if the new location has a different host than the one defined in the baseUrl.

Take this example I've been working on, using github's API to get an archive. Making a request to https:/api.github.com/repos/jgantunes/search-trees/tarball/master returns a 302 and location header Location: https://codeload.github.com/JGAntunes/search-trees/legacy.tar.gz/master. However, due to the way the redirect is invoked - https://github.com/hapijs/wreck/blob/master/lib/index.js#L192 - and how the url is resolved - https://github.com/hapijs/wreck/blob/master/lib/index.js#L54 - the new request will fail due to its wrong host, resulting in https://api.github.com/JGAntunes/search-trees/legacy.tar.gz/master.

@hueniverse hueniverse assigned hueniverse and unassigned hueniverse Jun 2, 2016
@geek geek added this to the 8.0.2 milestone Aug 2, 2016
@geek geek self-assigned this Aug 2, 2016
@geek geek closed this in #142 Aug 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.