import { minifiedContentSecurityPolicy } from "./content-security-policy";
export default {
async fetch(request: Request) {
const response = await fetch(request);
// Clone the response so that it's no longer immutable
const newResponse = new Response(response.body, response);
if (!newResponse.headers.has("Content-Security-Policy-Report-Only")) {
newResponse.headers.append(
"Content-Security-Policy-Report-Only",
minifiedContentSecurityPolicy,
);
}
return newResponse;
},
};
import { minifiedContentSecurityPolicy } from "./content-security-policy";
export default {
async fetch(request: Request) {
const response = await fetch(request);
// Clone the response so that it's no longer immutable
const newResponse = new Response(response.body, response);
if (!newResponse.headers.has("Content-Security-Policy-Report-Only")) {
newResponse.headers.append(
"Content-Security-Policy-Report-Only",
minifiedContentSecurityPolicy,
);
}
return newResponse;
},
};