From 5c01f59b7ee6d6ce8095f3baea7ad9818fe9fb20 Mon Sep 17 00:00:00 2001 From: Rhys Arkins <rhys@arkins.net> Date: Fri, 19 Jan 2018 15:28:54 +0100 Subject: [PATCH] refactor: limit github pagination to 1000 total --- lib/platform/github/gh-got-wrapper.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/platform/github/gh-got-wrapper.js b/lib/platform/github/gh-got-wrapper.js index 72f7fd8217..ab3951483d 100644 --- a/lib/platform/github/gh-got-wrapper.js +++ b/lib/platform/github/gh-got-wrapper.js @@ -37,7 +37,7 @@ async function get(path, opts, retries = 5) { if (opts && opts.paginate) { // Check if result is paginated const linkHeader = parseLinkHeader(res.headers.link); - if (linkHeader && linkHeader.next) { + if (linkHeader && linkHeader.next && res.body.length < 1000) { res.body = res.body.concat( (await get(linkHeader.next.url, opts, retries)).body ); -- GitLab