Skip to content
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

gz not served #877

Open
Chr96er opened this issue Mar 15, 2024 · 1 comment
Open

gz not served #877

Chr96er opened this issue Mar 15, 2024 · 1 comment

Comments

@Chr96er
Copy link

Chr96er commented Mar 15, 2024

I'm trying to serve compressed versions of my HTML files. I've added the -g flag and I see Serve GZIP Files: true during startup. I've zipped a test file using gzip.

  • When I try to access the file without the .gz extension I get a 404
  • When I access the file with .gz I get the gzipped file
  • When I copy the unzipped file and try to access that I am served the unzipped file (no Content-Encoding response header) - although for the screenshot I simply copied the compressed file without .gz extension.

As you can see in the screenshot the request header contains Accept-Encoding: gzip.

I'm basically seeing this issue but I'm on version 14.1.1

image

Environment Versions

  1. Node version: 20.8.0 (node:20.8.0-slim docker image)
  2. http-server version: 14.1.1

Steps to reproduce

Run http-server with -g flag and try to access a file (without .gz extension) for which a .gz version is available.

Expected result

The gzipped file is being served and decompressed client side.

Actual result

404 when trying to access the file without .gz extension.

@Chr96er
Copy link
Author

Chr96er commented Mar 18, 2024

Update: I manually ran fs.stat and hasGzipId12 in an interactive node session on the server (from within docker) and neither fails. !gzipErr is true and isGzip is also true. So I can only assume that something goes wrong before it even gets to that code.

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

No branches or pull requests

1 participant