This test describes the issue:
func Test(t *testing.T) {
r := router.New()
r.GET("/{path:*}", func(ctx *fasthttp.RequestCtx) {
ctx.WriteString("hello")
})
r.GET("/test/{path:*}", func(ctx *fasthttp.RequestCtx) {
ctx.WriteString("world")
})
do := func(uri string) string {
rc := &fasthttp.RequestCtx{
Request: *fasthttp.AcquireRequest(),
}
rc.Request.SetRequestURI(uri)
r.Handler(rc)
return string(rc.Response.Body())
}
assert.Equal(t, do("/tes"), "hello")
assert.Equal(t, do("/test/test"), "world")
assert.Equal(t, do("/test"), "???")
}