goadesign / goa

🌟 Goa: Elevate Go API development! 🚀 Streamlined design, automatic code generation, and seamless HTTP/gRPC support. ✨
https://goa.design
MIT License
5.69k stars 560 forks source link

Refactor file server implementation #3588

Closed raphael closed 2 months ago

raphael commented 2 months ago

So that it doesn't require introducing a Replace function. The new implementation is more robust and properly handles cases where the file path is deep and differs from the mount path.

tchssk commented 1 month ago

This code cannot handle cases where the filename is different between request and file system. My project contains that cases and v3.19.0 breaks the code.

Files("/index.html", "/www/data/another.html")
tchssk commented 1 month ago

@raphael

raphael commented 1 month ago

Whoops, yes that makes sense, I think we can modify the generated appendFS struct to handle this case - let me take a stab at it.

raphael commented 1 month ago

Would you be able to test https://github.com/goadesign/goa/pull/3593 to see if its fixes the issue? Thank you!