Skip to content

Commit

Permalink
PyPI fixes and prevent unknown requests from failing bad
Browse files Browse the repository at this point in the history
See #465
  • Loading branch information
espadrine committed Jun 7, 2015
1 parent c53b8a2 commit 0854d8b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion server.js
Original file line number Diff line number Diff line change
Expand Up @@ -1540,7 +1540,7 @@ cache(function(data, match, sendBadge, request) {
if (matched && matched[1] && matched[2]) {
statusCode = matched[1];
statusText = matched[2].toLowerCase().replace('-', '--');
if (statusText == 'production/stable') {
if (statusText === 'production/stable') {
statusText = 'stable';
}
break;
Expand All @@ -1550,6 +1550,10 @@ cache(function(data, match, sendBadge, request) {
badgeData.text[1] = statusText;
badgeData.colorscheme = statusColors[statusCode];
sendBadge(format, badgeData);
} else {
// That request is incorrect.
badgeData.text[1] = 'request unknown';
sendBadge(format, badgeData);
}
} catch(e) {
badgeData.text[1] = 'invalid';
Expand Down

0 comments on commit 0854d8b

Please sign in to comment.