Open lephattan opened 2 months ago
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
thx for sharing, which version do you use?
@ReneWerner87 I am using fiber v2.52.5 with go 1.23.0
thx for sharing, which version do you use?
https://github.com/gofiber/fiber/blob/6e7411403adc3f82cb941b6a038566006ed6e270/router.go#L404
@ReneWerner87
I found that when using mount
, although the expected path of fs.root
is correct, the result of fasthttp ctx.Path
is '/' and '/public', which causes the access path to change from public
to public/public
, which is the reason for this bug.
fs := &fasthttp.FS{
Root: root,
https://github.com/valyala/fasthttp/blob/c3050516d957b5bf75b353683c50302e4f955c6b/fs.go#L1074
// expect: ctx.Path ="/" filepath = "E:\projects_go\server\public"
// fact: ctx.Path = "/public" filepath = "E:\projects_go\server\public\public"
ff, err = h.openFSFile(filePath, mustCompress, fileEncoding)
Same issue for me. So I submit a PR.
Question Description
I am trying to set app a static server in a sub app, but it does not seem to work. The problem can be reproduced with the snippet below.
Project struture:
Tests:
Code Snippet (optional)
Checklist: