erlyaws / yaws

Yaws webserver
https://erlyaws.github.io
BSD 3-Clause "New" or "Revised" License
1.28k stars 267 forks source link

question (maybe bug) about use_gzip_static #379

Closed leoliu closed 5 years ago

leoliu commented 5 years ago

I have Yaws' deflate configured with use_gzip_static on.

If I only have x.js.gz but not x.js should Yaws be able to serve a request that accepts gzip? At the moment it seems Yaws always return 404 in this case though it can perfectly fulfil the request.

vinoski commented 5 years ago

I believe Yaws is correct in this case because the resource you're requesting, x.js, does not exist. The existence of an optimized version available for delivery under particular circumstances doesn't override the fact that the requested resource doesn't exist. In other words, it would be erroneous if you made a plain request for x.js and got a 404 but then said "hey I can handle gzipped content" and then got a 200.

leoliu commented 5 years ago

Thanks. That makes sense.