From 3ece1ecec9be5c663852d47e9f754e839dc44967 Mon Sep 17 00:00:00 2001 From: timkim Date: Tue, 15 Nov 2016 16:27:24 -0800 Subject: [PATCH] [#182] - fix failing test --- lib/util/injector-transform.js | 5 ++--- spec/fixture/app-with-csp/www/index.html | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/util/injector-transform.js b/lib/util/injector-transform.js index 6095fff..df78f07 100644 --- a/lib/util/injector-transform.js +++ b/lib/util/injector-transform.js @@ -44,7 +44,7 @@ module.exports = function(options) { // this is a little weird to parse the exact portion of the meta head that we need var result = cspRegex.exec(newChunk); - if(result != null && result.length>=2) { + if(result != null) { cspObject = cspParser(result[1]); cspString = cspBuilder(cspObject); cspTag = ''; @@ -53,7 +53,7 @@ module.exports = function(options) { if(options.emitter) { options.emitter.emit('log', '[console.warn]'.yellow + ' Content Security Policy has been modified to be:', cspTag); } - } else if(result == null){ + } else { cspObject = {}; cspString = cspBuilder(cspObject); cspTag = ''; @@ -63,7 +63,6 @@ module.exports = function(options) { options.emitter.emit('log', '[console.warn]'.yellow + ' Content Security Policy has been added:', cspTag); } } - this.push(newChunk); callback(); }; diff --git a/spec/fixture/app-with-csp/www/index.html b/spec/fixture/app-with-csp/www/index.html index e2d914d..be1c78d 100644 --- a/spec/fixture/app-with-csp/www/index.html +++ b/spec/fixture/app-with-csp/www/index.html @@ -1,6 +1,6 @@ - + Hello World