From 2bb97240f1a985d80a78a0ef589e72de769e1e23 Mon Sep 17 00:00:00 2001 From: Rhys Arkins <rhys@arkins.net> Date: Mon, 23 Jul 2018 13:11:56 +0200 Subject: [PATCH] fix(github): detect rate limit correctly --- lib/platform/github/gh-got-wrapper.js | 2 +- test/platform/github/gh-got-wrapper.spec.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/platform/github/gh-got-wrapper.js b/lib/platform/github/gh-got-wrapper.js index 026a555f86..f5b88771a3 100644 --- a/lib/platform/github/gh-got-wrapper.js +++ b/lib/platform/github/gh-got-wrapper.js @@ -139,7 +139,7 @@ async function get(path, options, retries = 5) { }, 'Bad credentials' ); - if (rateLimit === 60) { + if (rateLimit === '60') { throw new Error('platform-failure'); } throw new Error('bad-credentials'); diff --git a/test/platform/github/gh-got-wrapper.spec.js b/test/platform/github/gh-got-wrapper.spec.js index 533333f957..25aa3e10b7 100644 --- a/test/platform/github/gh-got-wrapper.spec.js +++ b/test/platform/github/gh-got-wrapper.spec.js @@ -96,7 +96,7 @@ describe('platform/gh-got-wrapper', () => { statusCode: 401, message: 'Bad credentials. (401)', headers: { - 'x-ratelimit-limit': 60, + 'x-ratelimit-limit': '60', }, }) ); -- GitLab