-
Notifications
You must be signed in to change notification settings - Fork 47
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
Routing not working properly with catch-all params #31
Comments
Hi @alex-rufo , Well seen! Thanks. |
Hey 👋 I think I spotted a related issue. Using a custom I adapted @alex-rufo 's code to be able to reproduce: package main
import (
"log"
"github.com/fasthttp/router"
"github.com/valyala/fasthttp"
)
func Catchall(ctx *fasthttp.RequestCtx) {
ctx.WriteString("Catchall!")
}
func Specific(ctx *fasthttp.RequestCtx) {
ctx.WriteString("Specific!")
}
func main() {
r := router.New()
r.HandleOPTIONS = false
r.OPTIONS("/{path:*}", Catchall)
r.POST("/specific/", Specific)
log.Fatal(fasthttp.ListenAndServe(":8080", r.Handler))
} Before, calling curl -v -X OPTIONS 'localhost:8080/specific/' would lead to For |
Hi @alex-rufo and @Dot-H, I've been release v1.1.2 that's fix the issue. Thanks! |
I have some problems routing some requests when using catch-all params. I am using version v1.1.1 and this is the code:
I would expect any request different than POST
/specific
to be caught by theCatchall
handler, but this is not what is actually happening. For the exact POST/specific
and any request that is not starting with/specific
it works fine but for the following cases it is not:/specific
/specific/whatever
/specific/whatever
The server is just returning a redirect. I think this is due to the radix tree, but I would expect another behavior.
The text was updated successfully, but these errors were encountered: