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

gschambers
Copy link
Contributor

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
Fixes redirect behavior to correctly set host
/port
@mzabriskie mzabriskie merged commit a473744 into axios:master Jan 19, 2016
@mzabriskie
Copy link
Member

This fix is available in 0.9.1

@gschambers
Copy link
Contributor Author

Great, thanks 👍

@axios axios locked and limited conversation to collaborators May 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy