Hi there!
I am working on a Worker that simply edits a response by adding “X-Dummy-Header”: “etc”
The code looks like a bit like this
async function handleRequest(request) {
// Make the headers mutable by re-constructing the Request.
request = new Request(request);
let response = await fetch(request);
response = new Response(response.body, response);
response.headers.set("X-Dummy-Header", "Hello world");
return response;
}
addEventListener("fetch", (event) => {
event.respondWith(handleRequest(event.request));
});
This worker is currently active on this route https://gpt3.jsonresume.org/
Which points at an IPFS bucket, if you look closely, the header is not present.
But when I point that domain at a regular origin, the header it is present.
It seems like when I am fetching from IPFS, I cannot change the response header.
Thanks for your time!