-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
🐛 [Bug]: Static server in sub app does not work #3104
Labels
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 |
thx for sharing, which version do you use? |
@ReneWerner87 I am using fiber v2.52.5 with go 1.23.0
|
Line 404 in 6e74114
@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, // 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) |
yinheli
added a commit
to yinheli/fiber
that referenced
this issue
Sep 14, 2024
yinheli
added a commit
to yinheli/fiber
that referenced
this issue
Sep 14, 2024
10 tasks
Same issue for me. So I submit a PR. |
yinheli
added a commit
to yinheli/fiber
that referenced
this issue
Sep 14, 2024
yinheli
added a commit
to yinheli/fiber
that referenced
this issue
Sep 14, 2024
yinheli
added a commit
to yinheli/fiber
that referenced
this issue
Sep 15, 2024
yinheli
added a commit
to yinheli/fiber
that referenced
this issue
Sep 15, 2024
yinheli
added a commit
to yinheli/fiber
that referenced
this issue
Sep 15, 2024
yinheli
added a commit
to yinheli/fiber
that referenced
this issue
Sep 15, 2024
yinheli
added a commit
to yinheli/fiber
that referenced
this issue
Sep 15, 2024
yinheli
added a commit
to yinheli/fiber
that referenced
this issue
Sep 15, 2024
yinheli
added a commit
to yinheli/fiber
that referenced
this issue
Sep 15, 2024
yinheli
added a commit
to yinheli/fiber
that referenced
this issue
Sep 15, 2024
yinheli
added a commit
to yinheli/fiber
that referenced
this issue
Sep 15, 2024
yinheli
added a commit
to yinheli/fiber
that referenced
this issue
Sep 15, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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:
The text was updated successfully, but these errors were encountered: