Worker is forcing to encode body for text/plain even it's a HEAD request

Hi everyone.

Just as the title said, if the
Request have header Accept-Encoding: br, and response
Content-Type
is text/plain, workers will forcing to encode body to br,
Even it's a HEAD request, and the body is actually empty.

That caused the Conteht-Length header got removed from response by worker, and my application can't determine how big is the file.

The best(maybe?) practice to solve it on client-side is set Accept-Encoding to identity

But this solution won't work on browser, because browser doesn't allow to change Accept-Encoding header.

I understand this behavior is fully RFC compatible, but in this case, it was not possible to get Content-Length in browser without any hack (like custom x-content-length header).

So is there any suggestion of settings of browser HEAD, or is there any chance of this server-side behavior being change in future ?
Snipaste_2024-02-06_20-45-29.png
Was this page helpful?