Skip to content

Commit

Permalink
[#182] - fixed csp for matching newlines in policy
Browse files Browse the repository at this point in the history
  • Loading branch information
timkim committed Nov 15, 2016
1 parent faa0dbd commit 83a997a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/util/injector-transform.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ module.exports = function(options) {
InjectHTML.prototype._transform = function (chunk, encoding, callback) {
// Inject our scripts at the bottom of the body tag
var newChunk = chunk.toString().replace(replaceText, replaceText + injectScript + '\n');
var cspRegex = /<meta.+Content-Security-Policy.+content.+"(.+)".*[^-]>/i;
var cspRegex = /<meta[^>]+Content-Security-Policy[^>]+content[^>]+"([^>]+)"[^>]*[^-]>/im;
var cspObject, cspString, cspTag;

// if we find an existing csp - warn the user about their csp being modified
Expand Down

0 comments on commit 83a997a

Please sign in to comment.