8000 `/public/[filename].gz` missing `Content-Encoding: gzip` Header · Issue #3379 · nitrojs/nitro · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

/public/[filename].gz missing Content-Encoding: gzip Header #3379

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
OrbisK opened this issue May 30, 2025 · 2 comments
Open

/public/[filename].gz missing Content-Encoding: gzip Header #3379

OrbisK opened this issue May 30, 2025 · 2 comments

Comments

@OrbisK
Copy link
OrbisK commented May 30, 2025

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

  1. run reproduction
  2. open network tab
  3. inspect .gz file response headers in network tab

Describe the bug

Reproduced nuxt/nuxt#26420 in nitro-only

Additional context

No response

Logs

@kricsleo
Copy link
Member
kricsleo commented Jun 2, 2025

Although I created #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.

@OrbisK
Copy link
Author
OrbisK commented Jun 2, 2025

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants
0