Fiber version
github.com/gofiber/fiber v1.13.3
Issue description
Params in route not worked
Code snippet
package main
import (
"fmt"
"github.com/gofiber/fiber"
)
func main() {
app := fiber.New()
grp := app.Group("/.well-known/test", func(c *fiber.Ctx) {
c.Next()
})
grp.Get("/", func(c *fiber.Ctx) { // work
c.Send("Hello, World 馃憢!")
})
grp.Get("/ok", func(c *fiber.Ctx) { // work
c.Send("OK")
})
grp.Get("/js/:name", func(c *fiber.Ctx) { // NOT WORK
msg := fmt.Sprintf("Hello, %s 馃憢!", c.Params("name"))
c.Send(msg) // => Hello john 馃憢!
})
app.Listen(3000)
}
changing
grp := app.Group("/.well-known/test", func(c *fiber.Ctx) {
c.Next()
})
to
grp := app.Group("/well-known/test", func(c *fiber.Ctx) {
c.Next()
})
Will work
solved with PR https://github.com/gofiber/fiber/pull/715
will be included in the next release
at the heart of the problem is that dot is a delimiter, just like dash and slash and the old logic expected something to stand between two delimiters, now the logic is a bit smarter and it just needs to know that it is a delimiter to terminate parameters