From 26847dca808ec4b43512771ccfaa6345ffe16086 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Georges=20Dup=C3=A9ron?= Date: Wed, 19 Apr 2017 05:55:19 +0200 Subject: [PATCH] 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 --- server.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server.js b/server.js index 086f0f8..5411be7 100644 --- a/server.js +++ b/server.js @@ -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");