1
0
mirror of https://github.com/kkapsner/CanvasBlocker synced 2024-05-29 01:18:06 +02:00

Do not add CSP headers to 304 requests

Fixes #577
This commit is contained in:
kkapsner 2021-09-09 17:40:18 +02:00
parent 2f6ca07bba
commit cca81c4006

View File

@ -47,7 +47,10 @@
scope.init = function(){ scope.init = function(){
function listener(details){ function listener(details){
const headers = details.responseHeaders; const headers = details.responseHeaders;
if (settings.get("blockDataURLs", new URL(details.url))){ if (
details.statusCode !== 304 &&
settings.get("blockDataURLs", new URL(details.url))
){
const cspMatch = (blockBlob? "": "blob: ") + "filesystem: *"; const cspMatch = (blockBlob? "": "blob: ") + "filesystem: *";
logging.verbose("Adding CSP header to", details); logging.verbose("Adding CSP header to", details);
setHeader(headers, { setHeader(headers, {