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
馃悰 Static path with trailing slashes doesn't work! #1490
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 |
Even if you try to force |
|
could be that the error lies there |
This is not related to fasthttp. I just tried debugging it, looks like the handler does not get called at all in |
May be fixed by #1538 |
package main
import (
"github.com/gofiber/fiber/v2"
)
func main() {
app := fiber.New()
app.Static("/web", "./web")
app.Listen(":3000")
} go.mod module tmp_static_web
go 1.15
require github.com/gofiber/fiber/v2 v2.19.1-0.20211001105148-b94870d8865b |
If you want to use trailing slash to register static file routing, then you may need such modification. @ReneWerner87 if necessary, I can PR. demo package main
import (
"github.com/gofiber/fiber/v2"
)
func main() {
app := fiber.New()
app.Static("/static", "./public", fiber.Static{
Browse: true,
})
app.Static("/test_static/", "./public", fiber.Static{
Browse: true,
})
app.Static("/web", "./public/web")
app.Static("/test_web/", "./public/web")
app.Listen(":3000")
} go.mod module tmp_static_trailing_slash
go 1.15
require github.com/gofiber/fiber/v2 v2.19.0
replace github.com/gofiber/fiber/v2 v2.19.0 => github.com/fufuok/fiber/v2 v2.19.1-0.20211001150354-c126d46683c1 You can visit the following URL:
demo code |
Fiber version
v2.17.0
Issue description
Static path with trailing slashes does not work! When path ends with slash like /docs/ or docs/ , the path is not found!
Code snippet
The text was updated successfully, but these errors were encountered: