mirror of
https://github.com/gorhill/uBlock.git
synced 2026-03-11 09:04:36 +00:00
minor code review
This commit is contained in:
parent
557f378bf8
commit
e50a05a8d0
1 changed files with 2 additions and 2 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue