Implemtned new regex to support tokens in the request url path rather

than a new query string
This commit is contained in:
Chris Reeves 2015-05-21 15:46:42 +01:00
parent cbd12a7580
commit e383f0e725

View File

@ -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,