From 9f6bad9277a9fa94d71bd3d7a8571e5d0dd861b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cjeramysoucy=E2=80=9D?= Date: Mon, 8 Jan 2024 16:05:11 -0500 Subject: [PATCH 1/2] Replaces trimStart with replace to de-duplicate path in pagination request. --- lib/snyk.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/snyk.js b/lib/snyk.js index 685f8f1..b21c179 100644 --- a/lib/snyk.js +++ b/lib/snyk.js @@ -132,7 +132,7 @@ async function paginateRestResponseData (url, headers, method = 'get') { json: true }) reponseData.push(...response.data) - if (response.links.next) url = baseRestUrl + response.links.next.trimStart('/rest') + if (response.links.next) url = baseRestUrl + response.links.next.replace('/rest','') else url = undefined } while (url) From 1adb27b36389c76e5625085936cc2cc7359e15d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cjeramysoucy=E2=80=9D?= Date: Mon, 8 Jan 2024 16:08:58 -0500 Subject: [PATCH 2/2] Fixes whitepsace formatting --- lib/snyk.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/snyk.js b/lib/snyk.js index b21c179..8625aad 100644 --- a/lib/snyk.js +++ b/lib/snyk.js @@ -132,7 +132,7 @@ async function paginateRestResponseData (url, headers, method = 'get') { json: true }) reponseData.push(...response.data) - if (response.links.next) url = baseRestUrl + response.links.next.replace('/rest','') + if (response.links.next) url = baseRestUrl + response.links.next.replace('/rest', '') else url = undefined } while (url)