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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
馃悰 [Bug]: serving a compress enabled public folder without +w permissions results in a 404 #2940
Comments
Thanks for opening your first issue here! 馃帀 Be sure to follow the issue template! If you need help or want to chat with us, join us on Discord https://gofiber.io/discord |
thanks for the report, probably the error is in the functionality we use from fasthttp can you try the whole thing directly with the fasthttp fs handler and see if it occurs there too, then we can pass it on to the core framework |
Hello @ReneWerner87, I am trying this:
but is not generating the gz files, do you know if I am missing something to trigger the generation? |
Bug Description
Serving a Static public folder when the user has no permissions to write makes the server requests return 404.
I was testing it on a docker container, and trying to repro this locally outside docker, it only failed in the container where the permissions to write were disabled.
However if I build the docker image after testing it locally outside the container and it happens to copy the public folder that already contains the .fiber.gz files then it works fine.
It was hard to realize this was the problem because from my perspective it worked sometimes and there was no propper error message suggesting what the problem was.
How to Reproduce
chmod -R ug-w ./public
BUG: it will fail with a 404
Add write permissions:
chmod -R u+w ./public
Run the code again
RESULT: It will pass now and generate all the .fiber.gz files inside public
Remove the permissions again
chmod -R u-w ./public
Run the code again
BUG: it now passes even when it can't write.
Expected Behavior
Fail with an error the tells the user that it could not write to the directory?? to the console or back to the browser with 500 and a message?
Fiber Version
3.0.0
Code Snippet (optional)
Checklist:
The text was updated successfully, but these errors were encountered: