File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -524,7 +524,6 @@ func optionsMethodHandler(allowMethods string) func(c Context) error {
524524// - Return it `Echo#ReleaseContext()`.
525525func (r * Router ) Find (method , path string , c Context ) {
526526 ctx := c .(* context )
527- ctx .path = path
528527 currentNode := r .tree // Current node as root
529528
530529 var (
Original file line number Diff line number Diff line change @@ -674,6 +674,18 @@ func TestRouterStatic(t *testing.T) {
674674 assert .Equal (t , path , c .Get ("path" ))
675675}
676676
677+ func TestRouterNoRoutablePath (t * testing.T ) {
678+ e := New ()
679+ r := e .router
680+ c := e .NewContext (nil , nil ).(* context )
681+
682+ r .Find (http .MethodGet , "/notfound" , c )
683+ c .handler (c )
684+
685+ // No routable path, don't set Path.
686+ assert .Equal (t , "" , c .Path ())
687+ }
688+
677689func TestRouterParam (t * testing.T ) {
678690 e := New ()
679691 r := e .router
You can’t perform that action at this time.
0 commit comments