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 duplicated searchParams for pagination API #1229

Merged

Conversation

fiznool
Copy link
Contributor

@fiznool fiznool commented May 6, 2020

Checklist

  • I have read the documentation.
  • I have included a pull request description of my changes.
  • I have included some tests.
  • If it's a new feature, I have included documentation updates.

As described in this comment, when using the pagination API searchParams are being erroneously duplicated.

This PR attempts to fix this problem by first checking for the existance of a searchParam before setting the default (or previous one, in the case of the pagination API).

A test case was also added to check that this works for default searchParams included using got.extend.

@szmarczak szmarczak merged commit 91aa0ac into sindresorhus:master May 10, 2020
@fiznool fiznool deleted the fix/pagniation-duplicated-search-params branch May 15, 2020 12:33
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

2 participants