Match CircleCI project host with trailing /

This prevents from misparsing /circleci/project/githubuser/repo.svg as user
"user".

Related to #798.
This commit is contained in:
Thaddee Tyl 2016-10-23 17:26:47 +02:00
parent dce818a7d2
commit 6e5904df0a

View File

@ -4512,7 +4512,7 @@ cache(function(data, match, sendBadge, request) {
// CircleCI build integration.
// https://circleci.com/api/v1/project/BrightFlair/PHP.Gt?circle-token=0a5143728784b263d9f0238b8d595522689b3af2&limit=1&filter=completed
camp.route(/^\/circleci\/(?:token\/(\w+))?[+\/]?project\/(github|bitbucket)?[+\/]?([^\/]+\/[^\/]+)(?:\/(.*))?\.(svg|png|gif|jpg|json)$/,
camp.route(/^\/circleci\/(?:token\/(\w+))?[+\/]?project\/(?:(github|bitbucket)\/)?([^\/]+\/[^\/]+)(?:\/(.*))?\.(svg|png|gif|jpg|json)$/,
cache(function(data, match, sendBadge, request) {
var token = match[1];
var type = match[2] || 'github'; // github OR bitbucket