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

Do not modify config.url when using a relative baseURL (resolves #1628) #2391

Conversation

multicolaure
Copy link
Contributor

When using a relative baseURL, the config.url was modified to include the baseURL.

In case of an error, it was impossible to retry the request with the config object, as the url was not the same as the original requested URL.

See issue #1628 for further details.

This pull request combines the baseURL and the url in the adapters, leaving untouched the config.url. Request interceptors can modify the baseURL, it will still be taken into account (issue #950).

Because config.url is modified while processing the request
when the baseURL is set,
it is impossible to perform a retry with the provided config object.

Ref axios#1628
As config.url is not modified anymore during the request processing.
The request can safely be retried after it failed with the provided
config.

resolves axios#1628
@multicolaure multicolaure force-pushed the hotfix/base-url-included-in-config-object-url branch from aece92f to 4f546cc Compare September 5, 2019 09:17
@multicolaure multicolaure changed the title Do not modify config.url when using a relative baseURL Do not modify config.url when using a relative baseURL (resolves #1628) Sep 5, 2019
@felipewmartins
Copy link
Collaborator

Thanks @multicolaure!! This closes #1628

@felipewmartins felipewmartins merged commit 6fe506f into axios:master Sep 5, 2019
genie-youn pushed a commit to genie-youn/axios that referenced this pull request Sep 27, 2019
…s#1628) (axios#2391)

* Adding tests to show config.url mutation

Because config.url is modified while processing the request
when the baseURL is set,
it is impossible to perform a retry with the provided config object.

Ref axios#1628

* Fixing url combining without modifying config.url

As config.url is not modified anymore during the request processing.
The request can safely be retried after it failed with the provided
config.

resolves axios#1628
@jlil
Copy link

jlil commented Oct 2, 2019

@felipewmartins When will this be released? Is there a release schedule we can use for tracking? Thanks

@christherama
Copy link

Bump on the above question - when will a release to include this fix be published on the npm registry?

This was referenced Jan 7, 2020
@axios axios locked and limited conversation to collaborators May 3, 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.

None yet

5 participants