Skip to content

Commit

Permalink
[#182] - fix failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
timkim committed Nov 16, 2016
1 parent 83a997a commit 3ece1ec
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions lib/util/injector-transform.js
Expand Up @@ -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 = '<meta http-equiv="Content-Security-Policy" content="' + cspString + '">';
Expand All @@ -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 = '<meta http-equiv="Content-Security-Policy" content="' + cspString + '">';
Expand All @@ -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();
};
Expand Down
2 changes: 1 addition & 1 deletion spec/fixture/app-with-csp/www/index.html
@@ -1,6 +1,6 @@
<html>
<head>
<meta http-equiv="Content-Security-Policy" content="default-src 'self' data: gap: https://ssl.gstatic.com 'unsafe-eval'; style-src 'self' 'unsafe-inline'; media-src *">
<meta http-equiv="Content-Security-Policy" content="default-src 'self' data: gap: https://ssl.gstatic.com 'unsafe-eval'; style-src 'self' 'unsafe-inline'; media-src *" />
<script src="cordova.js"></script>
<script src="cordova_plugins.js"></script>
<title>Hello World</title>
Expand Down

0 comments on commit 3ece1ec

Please sign in to comment.