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

Moving default adapter to global defaults #437

Merged
merged 1 commit into from
Sep 22, 2016

Conversation

rubennorte
Copy link
Member

I expect that this PR will make easier for the developers to debug which is the default adapter for a given environment and also to decorate them with any additional functionality.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.03%) to 93.979% when pulling b274587 on rubennorte:adapters-in-global-defaults into 755a9b3 on mzabriskie:master.

response.headers,
var adapter = config.adapter || defaults.adapter;

return adapter(config).then(function onAdapterResolution(response) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if config.adapter or defaults.adapter end up not being a function? In the previous if/else for selecting an adapter you always had a fallback in case config.adapter supplied something invalid.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we better detect it at this point rather than falling back to any other implementation without errors. That way is much harder to debug, don't you think?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with @rubennorte. Silently falling back to another adapter is not going to make anyone's life easier.

@dan-turner
Copy link

Any updates with this one?

@mzabriskie mzabriskie merged commit b718ebf into axios:master Sep 22, 2016
@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.

5 participants