Fix codeclimate's incorrect Content-Disposition

Solves #567
This commit is contained in:
Thaddee Tyl 2015-11-22 17:25:36 +01:00
parent 9a098a5e83
commit 155dcaa6d4

View File

@ -1999,7 +1999,7 @@ cache(function(data, match, sendBadge, request) {
}
try {
var score = res.headers['content-disposition']
.match(/filename="coverage_(.+)\.png"/)[1];
.match(/filename=".*coverage_(.+)\.png"/)[1];
if (!score) {
badgeData.text[1] = 'malformed';
sendBadge(format, badgeData);
@ -2040,7 +2040,7 @@ cache(function(data, match, sendBadge, request) {
}
try {
var statusMatch = res.headers['content-disposition']
.match(/filename="code_climate-(.+)\.png"/);
.match(/filename=".*code_climate-(.+)\.png"/);
if (!statusMatch) {
badgeData.text[1] = 'unknown';
sendBadge(format, badgeData);