Hello, here is the problem.
I need fetch other site saving original headers, so when I put
const resp = await fetch(event.request);
all working fine, when I change to
const resp = await fetch("https://httpbin.org/get");
all my initial headers is lost.
I understand that I need to copy initial headers like described in … /workers//runtime-apis/request#requestinit but don’t have idea how to do it, because
const newRequestInit = {
headers: event.request.headers
};
or similar - not working, or I doing something wrong
How I can transfer all old headers to now request?