Logging Headers in Console
An example of checking the content of headers by logging them to the console.
addEventListener("fetch", (event) => {
event.respondWith(handleRequest(event.request));
});
async function handleRequest(request) {
console.log(new Map(request.headers));
return new Response("Hello world");
}