File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Expand file tree Collapse file tree 2 files changed +13
-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,19 @@ 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+ request_path := "/notfound"
681+ c := e .NewContext (nil , nil ).(* context )
682+
683+ r .Find (http .MethodGet , request_path , c )
684+ c .handler (c )
685+
686+ // No routable path, don't set Path.
687+ assert .Equal (t , "" , c .Path ())
688+ }
689+
677690func TestRouterParam (t * testing.T ) {
678691 e := New ()
679692 r := e .router
You can’t perform that action at this time.
0 commit comments