-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Closed
Labels
Description
Issue Description
Context#Param(name string) doesn't work in certain constellations.
Checklist
- [ X ] Dependencies installed
- [ X ] No typos
- [ X ] Searched existing issues and docs
Expected behaviour
The following code yields results for handler1 (using c.Param("page")) and for handler3 and handler4 (using c.Param("id"))
mux.GET("path/:page", handler1)
mux.POST("path", handler2)
mux.PATCH("path/:id", handler3)
mux.DELETE("path/:id", handler4)
Actual behaviour
The following code yields and empty string for handler3 and handler4 (using c.Param("id")).
mux.GET("path/:page", handler1)
mux.POST("path", handler2)
mux.PATCH("path/:id", handler3)
mux.DELETE("path/:id", handler4)
The following code yields and empty string for handler1 (using c.Param("page")).
mux.POST("path", handler2)
mux.PATCH("path/:id", handler3)
mux.DELETE("path/:id", handler4)
mux.GET("path/:page", handler1)
Steps to reproduce
func handler3(c echo.Context) error {
idParam := c.Param("id")
log.Println(idParam);
}
Working code to debug
See above
Version/commit
Latest (github.com/labstack/echo)
infiz and redlotus