Skip to content

Commit

Permalink
fix: Set Paginator.nextParams to an empty object after first request
Browse files Browse the repository at this point in the history
This stops the duplication of query parameters in our request URL, as Mastodon already gives us the correct parameters in the `Link` header. In some cases, a mixture of parameters from `params` and the `Link` URL could cause the iterator to get caught in an infinite loop. Fixes #698.
  • Loading branch information
SuperSonicHub1 committed Nov 25, 2022
1 parent f7fce11 commit 4ce57a6
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/paginator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export class Paginator<Params, Result>
typeof response.headers?.link === 'string'
? this.pluckNext(response.headers.link)
: undefined;
this.nextParams = {} as Params;

return {
done: false,
Expand Down

0 comments on commit 4ce57a6

Please sign in to comment.