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

Fixes redirect behavior to correctly set host/port #198

Merged
merged 1 commit into from Jan 19, 2016

Conversation

Projects
None yet
2 participants
@gschambers
Copy link
Contributor

commented Jan 19, 2016

We currently supply options to follow-redirects in the format { host, port }, but the port is incorrectly dropped during redirect due to the way that url.format handles host vs hostname. For the purposes of http, host and hostname are aliases, but when building the redirect URL, host is assumed to be the full origin. We should supply hostname instead.

I have added a test for this case. I you change the options to use host instead of hostname, the tests will hang as the request is being incorrectly redirected to "http://localhost/two" instead of "http://localhost:4444/two".

mzabriskie added a commit that referenced this pull request Jan 19, 2016

Merge pull request #198 from gschambers/redirect-hostname
Fixes redirect behavior to correctly set host
/port

@mzabriskie mzabriskie merged commit a473744 into axios:master Jan 19, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@mzabriskie

This comment has been minimized.

Copy link
Member

commented Jan 24, 2016

This fix is available in 0.9.1

@gschambers

This comment has been minimized.

Copy link
Contributor Author

commented Jan 25, 2016

Great, thanks 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.