diff --git a/server.js b/server.js index 3d68953..3fb91f9 100644 --- a/server.js +++ b/server.js @@ -1535,12 +1535,12 @@ cache(function(data, match, sendBadge, request) { })); // Codecov integration. -camp.route(/^\/codecov\/c\/([^\/]+\/[^\/]+\/[^\/]+)(?:\/(.+))?\.(svg|png|gif|jpg|json)$/, +camp.route(/^\/codecov\/c\/(?:t:([A-Za-z1-9]+))?[+\/]?([^\/]+\/[^\/]+\/[^\/]+)(?:\/(.+))?\.(svg|png|gif|jpg|json)$/, cache(function(data, match, sendBadge, request) { - var userRepo = match[1]; // eg, `github/codecov/example-python`. - var branch = match[2]; - var format = match[3]; - var token = data['token']; // for private repositories (?token=1234) + var token = match[1]; + var userRepo = match[2]; // eg, `github/codecov/example-python`. + var branch = match[3]; + var format = match[4]; var apiUrl = { url: 'https://codecov.io/' + userRepo + '/coverage.svg', followRedirect: false,