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

fix(carto): Resolve conflicts between base URL and parameters #8925

Merged
merged 2 commits into from
May 29, 2024

Conversation

donmccurdy
Copy link
Collaborator

Changes:

  • If requestWithParameters base URL conflicts with given parameters, override base URL
  • Use URLSearchParams API to merge non-conflicting parameters cleanly
  • Move DEFAULT_PARAMETERS and DEFAULT_HEADERS to local constants in request-with-parameters.ts. When adding new DEFAULT_PARAMETERS we need to be careful of the precedence (user params > default params > base url params) and that information is clearer in context.
  • Update unit tests, since URLSearchParams#toString handles whitespace and trailing slashes differently than the previous URL building logic.

@coveralls
Copy link

coveralls commented May 28, 2024

Coverage Status

coverage: 89.896% (+0.006%) from 89.89%
when pulling 1e75ad7 on donmccurdy/fix-requestwithparams-override-baseurl
into 1e8b750 on master.

@donmccurdy donmccurdy force-pushed the donmccurdy/fix-requestwithparams-override-baseurl branch from a22838d to 1e75ad7 Compare May 29, 2024 15:15
@donmccurdy donmccurdy merged commit 03ce925 into master May 29, 2024
4 checks passed
@donmccurdy donmccurdy deleted the donmccurdy/fix-requestwithparams-override-baseurl branch May 29, 2024 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants