GitHub auth: only use user tokens if over rate limit

This commit is contained in:
Thaddee Tyl 2016-06-21 09:26:52 +02:00
parent 58cbb18c1d
commit a54a247f16

View File

@ -154,7 +154,7 @@ function githubRequest(request, url, query, cb) {
};
var token;
if (lowestReqRemainingToken != null) {
if (lowestReqRemainingToken != null && lowestReqRemaining > 0) {
token = lowestReqRemainingToken;
headers['Authorization'] = 'token ' + token;
} else if (serverSecrets && serverSecrets.gh_client_id) {