-
Notifications
You must be signed in to change notification settings - Fork 334
[dev] Different behavior of "Accept-Encoding" header #1425
Comments
ok - from my investigation when sending addEventListener('fetch', event => {
event.respondWith(handleRequest(event.request))
})
async function handleRequest(request) {
let accept_encoding = request.headers.get("Accept-Encoding")
console.log(accept_encoding)
let response = await fetch("https://example.com")
let content_encoding = response.headers.get("Content-Encoding")
console.log(content_encoding)
return response
}
|
This will be fixed when we release the stuff in #1085 - i just built
this is the same you see when you publish a worker 😄 edit: for context, |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
The issue is resolved with the recent change of using the latest edge workers. |
Original mentioned here as feedback for the
dev
mode.Currently the
wrangler dev
runtime has different behavior for theAccept-Encoding
header than a cloud deployed worker. Accessing it returns the actual values of a client (e.g.gzip, deflate, br
) which can be misleading as later on those won't be forwarded but always replaced withgzip
. Having them aligned helps to be consistent so developers can be aware of that circumstance before running the worker in production.The text was updated successfully, but these errors were encountered: