From 12573cd76d1f054cfd3c5567b52ef9c132714d91 Mon Sep 17 00:00:00 2001 From: Vishal Rana Date: Sat, 22 Oct 2016 12:32:39 -0700 Subject: [PATCH] fixed #675 Signed-off-by: Vishal Rana --- group.go | 10 +++++----- website/Makefile | 2 ++ 2 files changed, 7 insertions(+), 5 deletions(-) create mode 100644 website/Makefile diff --git a/group.go b/group.go index 63a44777..72c0c71c 100644 --- a/group.go +++ b/group.go @@ -16,11 +16,11 @@ type ( // Use implements `Echo#Use()` for sub-routes within the Group. func (g *Group) Use(m ...MiddlewareFunc) { g.middleware = append(g.middleware, m...) - // Allow all requests to reach the group as they might get dropped if router - // doesn't find a match, making none of the group middleware process. - g.echo.Any(g.prefix+"*", func(c Context) error { - return ErrNotFound - }, g.middleware...) + // Allow requests `/prefix & /prefix/*` to reach the group as they might get + // dropped if router doesn't find a match, making none of the group middleware + // execute. + g.echo.Any(g.prefix, NotFoundHandler, g.middleware...) + g.echo.Any(g.prefix+"/*", NotFoundHandler, g.middleware...) } // CONNECT implements `Echo#CONNECT()` for sub-routes within the Group. diff --git a/website/Makefile b/website/Makefile new file mode 100644 index 00000000..c5e4c030 --- /dev/null +++ b/website/Makefile @@ -0,0 +1,2 @@ +build: + rm -rf public && hugo