`/public/[filename].gz` missing `Content-Encoding: gzip` Header
Environment
https://stackblitz.com/edit/github-r5nvmagd?file=server%2Froutes%2Findex.ts,server%2Fpublic%2Fnitro.js
Reproduction
https://stackblitz.com/edit/github-r5nvmagd?file=server%2Froutes%2Findex.ts,server%2Fpublic%2Fnitro.js
- run reproduction
- open network tab
- inspect .gz file response headers in network tab
Describe the bug
Reproduced https://github.com/nuxt/nuxt/issues/26420 in nitro-only
Additional context
No response
Logs
Although I created https://github.com/nitrojs/nitro/pull/3381, I'm now unsure if Content-Encoding: gzip should be automatically added for .gz files.
This header would cause the browser to unzip the file. It might be useful in your scenarios where you want to use the JS content directly in the browser, but what if the user wants to download the raw .gz file? The browser will always unzip the file with this header before saving it to disk.
Perhaps we should give the user the option of whether or not to inject headers. We could add a publicApplyHeader function to apply headers via configuration.