Fix website badge for deep links (#720)
Works: https://img.shields.io/website/http/github.com.svg Does not work: https://img.shields.io/website/http/github.com/badges.svg Regexp was too greedy and included the beginning of the path in the protocol
This commit is contained in:
parent
5a8b565ebb
commit
26847dca80
|
@ -5833,7 +5833,7 @@ cache(function(data, match, sendBadge, request) {
|
|||
}));
|
||||
|
||||
// Test if a webpage is online
|
||||
camp.route(/^\/website(-(([^-]|--)*?)-(([^-]|--)*)(-(([^-]|--)+)-(([^-]|--)+))?)?\/(.+)\/(.+)\.(svg|png|gif|jpg|json)$/,
|
||||
camp.route(/^\/website(-(([^-]|--)*?)-(([^-]|--)*)(-(([^-]|--)+)-(([^-]|--)+))?)?\/([^/]+)\/(.+)\.(svg|png|gif|jpg|json)$/,
|
||||
cache(function(data, match, sendBadge, request) {
|
||||
var onlineMessage = escapeFormat(match[2] != null ? match[2] : "online");
|
||||
var offlineMessage = escapeFormat(match[4] != null ? match[4] : "offline");
|
||||
|
|
Loading…
Reference in New Issue
Block a user