From 63a4dabbb95fef9819f5244b132d3d867ef8321b Mon Sep 17 00:00:00 2001 From: Lee Jaeseong Date: Wed, 6 Jul 2022 03:42:24 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EB=AF=B8=EB=93=A4=EC=9B=A8=EC=96=B4?= =?UTF-8?q?=EA=B0=80=20=EC=9D=98=EB=8F=84=EB=90=98=EC=A7=80=20=EC=95=8A?= =?UTF-8?q?=EC=9D=80=20=EC=8B=9C=EC=A0=90=EC=97=90=EC=84=9C=20=EC=8B=A4?= =?UTF-8?q?=ED=96=89=EB=90=98=EB=8A=94=20=EB=B6=80=EB=B6=84=20=ED=95=B4?= =?UTF-8?q?=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- router_lambda.go | 5 ++++- router_local.go | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/router_lambda.go b/router_lambda.go index 0f4a544..feb948a 100644 --- a/router_lambda.go +++ b/router_lambda.go @@ -31,7 +31,10 @@ func (lr *lambdaRouter) AddRoute(method string, path string, handler HandlerFunc method = replaceMethodWildcardToBlank(method) r.params.setParamsInfo(method, findParamKeys(path)) - r.handlers.setHandler(method, wrapMiddleware(handler, middleware...)) + r.handlers.setHandler(method, func(c Context) error { + wrappedHandler := wrapMiddleware(handler, middleware...) + return wrappedHandler(c) + }) } func (lr *lambdaRouter) DelRoute(method string, path string) { diff --git a/router_local.go b/router_local.go index a2026e2..7e716f9 100644 --- a/router_local.go +++ b/router_local.go @@ -142,7 +142,10 @@ func (lr *localRouter) AddRoute(method string, path string, handler HandlerFunc, method = replaceMethodWildcardToBlank(method) (*targetRoute).params.setParamsInfo(method, pathParams) - (*targetRoute).handlers.setHandler(method, wrapMiddleware(handler, middleware...)) + (*targetRoute).handlers.setHandler(method, func(c Context) error { + wrappedHandler := wrapMiddleware(handler, middleware...) + return wrappedHandler(c) + }) } func (lr *localRouter) DelRoute(method string, path string) {