You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thank you, @aristidesfl! This is a bug that needs to be fixed asap.
Details
In the current version, axios.defaults is the default instance's config which is not the same as the object exported by the defaults module. Custom instances inherit the latter, but not the former, hence changing axios.defaults has no effect on a custom instance's config.
I think this can be fixed by modifying the axios.create method to merge the default instance config with the specified config as follows:
But since there are other issues with configuration (#385, #382, #370), I think it makes sense to address all of them at once . /cc @mzabriskie, @rubennorte
Activity
franciscolourenco commentedon Sep 12, 2016
The same with other options like timeout and interceptors.
cannap commentedon Sep 14, 2016
hi you need to set the base url for the new Axios instance are you sure it should inherit?
franciscolourenco commentedon Sep 14, 2016
Thats is what I understood from https://github.com/mzabriskie/axios#config-order-of-precedence
Global defaults get used if instance options are not provided.
If Global defaults are changed with
axios.defaultsthen they should be reflected in instances.If this is not supported, global defaults is a bit pointless. It would be a nice feature in any case.
nickuraltsev commentedon Sep 27, 2016
Thank you, @aristidesfl! This is a bug that needs to be fixed asap.
Details
In the current version,
axios.defaultsis the default instance's config which is not the same as the object exported by thedefaultsmodule. Custom instances inherit the latter, but not the former, hence changingaxios.defaultshas no effect on a custom instance's config.I think this can be fixed by modifying the
axios.createmethod to merge the default instance config with the specified config as follows:But since there are other issues with configuration (#385, #382, #370), I think it makes sense to address all of them at once . /cc @mzabriskie, @rubennorte
franciscolourenco commentedon Sep 27, 2016
@nickuraltsev as a workaround I've been using
axios.create(axios.defaults)whereaxios.defaultsis the modified defaults.yanivefraim commentedon Nov 8, 2016
Is someone working on that? Can I help? (: I would love to continue from here
@nickuraltsev ?
nickuraltsev commentedon Nov 27, 2016
Fixed via 6d0e193
fixing bug for issue axios#175 maybe axios#949 axios#443
chore(deps): update dependency axios to v0.18.0 (#488)