Implemtned new regex to support tokens in the request url path rather
than a new query string
This commit is contained in:
parent
cbd12a7580
commit
e383f0e725
10
server.js
10
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,
|
||||
|
|
Loading…
Reference in New Issue
Block a user