Skip to content

Commit

Permalink
[Github] File Size: improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
webcaetano committed Apr 29, 2017
1 parent 4e66f9f commit 200ccfa
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -3445,12 +3445,6 @@ cache(function(data, match, sendBadge, request) {
if (badgeData.template === 'social') {
badgeData.logo = badgeData.logo || logos.github;
}
// Using our OAuth App secret grants us 5000 req/hour
// instead of the standard 60 req/hour.
if (serverSecrets) {
apiUrl += '?client_id=' + serverSecrets.gh_client_id
+ '&client_secret=' + serverSecrets.gh_client_secret;
}

githubAuth.request(request, apiUrl, {}, function(err, res, buffer) {
if (err != null) {
Expand All @@ -3465,7 +3459,7 @@ cache(function(data, match, sendBadge, request) {
return;
}
var body = JSON.parse(buffer);
if (body.size != null) {
if (body && Number.isInteger(body.size)) {
badgeData.text[1] = prettyBytes(body.size);
badgeData.colorscheme = 'green';
sendBadge(format, badgeData);
Expand Down

0 comments on commit 200ccfa

Please sign in to comment.