diff --git a/server.js b/server.js index f877dc5..e073a04 100644 --- a/server.js +++ b/server.js @@ -287,15 +287,16 @@ camp.notfound(/.*/, function(query, match, end, request) { // JIRA issue integration camp.route(/^\/jira\/issue\/(http(?:s)?)\/(.+)\/([^\/]+)\.(svg|png|gif|jpg|json)$/, cache(function (data, match, sendBadge, request) { - var protocol = match[1]; - var host = match[2]; - var issueKey = match[3]; + var protocol = match[1]; // eg, https + var host = match[2]; // eg, issues.apache.org/jira + var issueKey = match[3]; // eg, KAFKA-2896 var format = match[4]; var options = { method: 'GET', json: true, - uri: protocol + '://' + host + '/rest/api/2/issue/' + issueKey + uri: protocol + '://' + host + '/rest/api/2/issue/' + + encodeURIComponent(issueKey) }; if (serverSecrets && serverSecrets.jira_username) { options.auth = { diff --git a/try.html b/try.html index b1ff637..4015452 100644 --- a/try.html +++ b/try.html @@ -723,7 +723,7 @@ Pixel-perfect   Retina-ready   Fast   Consistent   Hackable https://img.shields.io/gitter/room/nwjs/nw.js.svg JIRA issue: - + https://img.shields.io/jira/issue/https/issues.apache.org/jira/KAFKA-2896.svg