Roses are red, License badges are blue

… and this fixes issue #342.
This commit is contained in:
Thaddee Tyl 2015-01-06 19:38:22 +01:00
parent f1f2992ae4
commit bb2af1348c
2 changed files with 6 additions and 6 deletions

View File

@ -819,7 +819,7 @@ cache(function(data, match, sendBadge, request) {
}
}
badgeData.text[1] = version.license[0];
badgeData.colorscheme = 'red';
badgeData.colorscheme = 'blue';
sendBadge(format, badgeData);
} catch(e) {
badgeData.text[1] = 'invalid';
@ -916,7 +916,7 @@ cache(function(data, match, sendBadge, request) {
license = license.type;
}
badgeData.text[1] = license;
badgeData.colorscheme = 'red';
badgeData.colorscheme = 'blue';
sendBadge(format, badgeData);
} catch(e) {
badgeData.text[1] = 'invalid';
@ -1120,7 +1120,7 @@ cache(function(data, match, sendBadge, request) {
badgeData.text[1] = 'Unknown';
} else {
badgeData.text[1] = license;
badgeData.colorscheme = 'red';
badgeData.colorscheme = 'blue';
}
sendBadge(format, badgeData);
}
@ -1215,7 +1215,7 @@ cache(function(data, match, sendBadge, request) {
badgeData.text[1] = 'Unknown';
} else {
badgeData.text[1] = license;
badgeData.colorscheme = 'red';
badgeData.colorscheme = 'blue';
}
sendBadge(format, badgeData);
}
@ -2756,7 +2756,7 @@ cache(function(data, match, sendBadge, request) {
return;
}
badgeData.text[1] = license;
badgeData.colorscheme = 'red';
badgeData.colorscheme = 'blue';
sendBadge(format, badgeData);
});
}));

View File

@ -48,7 +48,7 @@ var githubLicense = function(user, repo, end) {
apiUrl += '?client_id=' + serverSecrets.gh_client_id
+ '&client_secret=' + serverSecrets.gh_client_secret;
}
var badgeData = {text:['license',''], colorscheme:'red'};
var badgeData = {text:['license',''], colorscheme:'blue'};
// A special User-Agent is required:
// http://developer.github.com/v3/#user-agent-required
request(apiUrl, { headers: { 'User-Agent': 'Shields.io' } }, function(err, res, buffer) {