minor code review

This commit is contained in:
gorhill 2017-04-26 12:50:05 -04:00
parent 557f378bf8
commit e50a05a8d0
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2
1 changed files with 2 additions and 2 deletions

View File

@ -567,7 +567,7 @@ var foilWithCSP = function(headers, noInlineScript, noWebsocket, noBlobWorker) {
if ( cspSubset.length === 0 ) { return; }
var csp = '';
var csp;
if ( i !== -1 ) {
csp = headers[i].value.trim();
headers.splice(i, 1);
@ -580,7 +580,7 @@ var foilWithCSP = function(headers, noInlineScript, noWebsocket, noBlobWorker) {
cspSubset = cspSubset.join('; ');
headers.push({
name: 'Content-Security-Policy',
value: csp.length === 0 ? cspSubset : csp + ', ' + cspSubset
value: csp === undefined ? cspSubset : csp + ', ' + cspSubset
});
return true;