mirror of
https://github.com/labstack/echo.git
synced 2025-07-17 01:43:02 +02:00
Return an empty string for ctx.path if there is no registered path
This commit is contained in:
@ -674,6 +674,18 @@ func TestRouterStatic(t *testing.T) {
|
||||
assert.Equal(t, path, c.Get("path"))
|
||||
}
|
||||
|
||||
func TestRouterNoRoutablePath(t *testing.T) {
|
||||
e := New()
|
||||
r := e.router
|
||||
c := e.NewContext(nil, nil).(*context)
|
||||
|
||||
r.Find(http.MethodGet, "/notfound", c)
|
||||
c.handler(c)
|
||||
|
||||
// No routable path, don't set Path.
|
||||
assert.Equal(t, "", c.Path())
|
||||
}
|
||||
|
||||
func TestRouterParam(t *testing.T) {
|
||||
e := New()
|
||||
r := e.router
|
||||
|
Reference in New Issue
Block a user