-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Closed
Description
Issue Description
If static routing and dynamic routing have only the last or several characters different, there will be routing conflicts.
Checklist
e.GET("/ups/person",hello)
e.GET("/users/new", hello)
e.GET("users/:name", hello)
curl localhost:1323/users/new --- ok
curl localhost:1323/users/new2 --- 404
- Dependencies installed
- No typos
- Searched existing issues and docs
Expected behaviour
curl localhost:1323/users/new --- ok
curl localhost:1323/users/new2 --- ok
Actual behaviour
curl localhost:1323/users/new --- ok
curl localhost:1323/users/new2 --- 404
Steps to reproduce
Working code to debug
package main
import (
"net/http"
"github.com/labstack/echo"
"github.com/labstack/echo/middleware"
)
func main() {
// Echo instance
e := echo.New()
// Middleware
e.Use(middleware.Logger())
e.Use(middleware.Recover())
// Routes
e.GET("/", hello)
e.GET("/ups/person",hello)
e.GET("/users/new", hello)
e.GET("/users/:name", hello)
// Start server
e.Logger.Fatal(e.Start(":1323"))
}
// Handler
func hello(c echo.Context) error {
return c.String(http.StatusOK, "Hello, World!")
}Version/commit
denniselite
Metadata
Metadata
Assignees
Labels
No labels