Skip to content

Commit

Permalink
fix: Use improved pagination regex to remove service url + leaf
Browse files Browse the repository at this point in the history
fixes: #352
  • Loading branch information
jetersen authored and jdalrymple committed Jun 12, 2019
1 parent 688c1f2 commit 2b290b5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/infrastructure/RequestHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ export async function get(
// Rescurse through pagination results
if (!query.page && underLimit && pagination.next) {
const { next } = Li.parse(headers.link);
const more = await get(service, next.replace(`${service.url}/`, ''), {
const leaf = service.url.split('/').pop() || ""
const regex = new RegExp(`.+\/api\/v\d(\/${leaf})?\/`)
const more = await get(service, next.replace(regex, ''), {
maxPages,
sudo,
showPagination: true
Expand Down

0 comments on commit 2b290b5

Please sign in to comment.