From 8d4a0c34e7645d471acc93d67ac94179f125943e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABl=20M=C3=A9tais?= Date: Fri, 19 Jun 2015 18:45:34 +0200 Subject: [PATCH] Fix requests offenders --- front/src/views/rule.html | 3 +-- lib/metadata/policies.js | 2 +- lib/offendersHelpers.js | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/front/src/views/rule.html b/front/src/views/rule.html index 1d74569..fda2731 100644 --- a/front/src/views/rule.html +++ b/front/src/views/rule.html @@ -137,9 +137,8 @@ -
+
- ({{offender.size}} KB)
diff --git a/lib/metadata/policies.js b/lib/metadata/policies.js index b785c47..b80d276 100644 --- a/lib/metadata/policies.js +++ b/lib/metadata/policies.js @@ -900,7 +900,7 @@ var policies = { "isBadThreshold": 100, "isAbnormalThreshold": 200, "hasOffenders": true, - "takeOffendersFrom": ["htmlCount", "jsCount", "cssCount", "imageCount", "webfontCount", "videoCount", "jsonCount", "jsonCount"], + "takeOffendersFrom": ["htmlCount", "jsCount", "cssCount", "imageCount", "webfontCount", "videoCount", "jsonCount", "otherCount"], "offendersTransformFn": function(offenders) { return { count: offenders.length, diff --git a/lib/offendersHelpers.js b/lib/offendersHelpers.js index a3630e0..862e660 100644 --- a/lib/offendersHelpers.js +++ b/lib/offendersHelpers.js @@ -168,7 +168,7 @@ var OffendersHelpers = function() { }; this.fileWithSizePattern = function(fileWithSize) { - var parts = /^([^ ]*) \((\d+\.\d{2}) kB\)$/.exec(fileWithSize); + var parts = /^([^ ]*) \((\d+\.\d{2}|NaN) kB\)$/.exec(fileWithSize); if (!parts) { return {