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

Merge defaults, request config, and instance config in request method and add support for defaults.baseURL #179

Closed
wants to merge 2 commits into from

Conversation

nickuraltsev
Copy link
Member

Fixes #175

@mzabriskie
Copy link
Member

As I was looking over your PR I realized that there is a fundamental problem with the way that defaults/config has historically been implemented. I started trying to describe the problems as I saw them, but ultimately decided that I could show what I meant more easily with a diff. Take a look at my commit and let me know what you think. 82847f7

In short:

  • I removed any reference to defaults outside of lib/axios
  • Moved transformData and merging headers out of adapters into Axios.prototype.request
  • Establish an order of precedence to be defaults, this.defaults, config

I was able to catch some existing buggy behavior while I was writing tests for this refactor and I think this will be more stable all around.

If you think that this approach makes sense I will merge my branch.

@nickuraltsev
Copy link
Member Author

Your commit looks great. It's definitely a better way to solve the issue with defaults than #179.

@mzabriskie
Copy link
Member

Thanks for the feedback. Also I appreciate your PR.

@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.

Setting baseURL in default configuration
2 participants