From 9bb985515370a3cd577f4097b60fa35dfd46dca3 Mon Sep 17 00:00:00 2001 From: ziyel Date: Mon, 18 May 2015 14:42:18 +0800 Subject: [PATCH 1/2] Let filter function get more params info from ctx.Input.Params --- router.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/router.go b/router.go index b9d649a2..232f67d2 100644 --- a/router.go +++ b/router.go @@ -612,6 +612,9 @@ func (p *ControllerRegistor) ServeHTTP(rw http.ResponseWriter, r *http.Request) if l, ok := p.filters[pos]; ok { for _, filterR := range l { if ok, p := filterR.ValidRouter(urlPath); ok { + for k, v := range context.Input.Params { + p[k] = v + } context.Input.Params = p filterR.filterFunc(context) if filterR.returnOnOutput && w.started { From d943d16d522cefb97ae2735f1e3dd8b41e6d8641 Mon Sep 17 00:00:00 2001 From: ziyel Date: Wed, 10 Jun 2015 21:26:04 +0800 Subject: [PATCH 2/2] gofmt --- router.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/router.go b/router.go index 232f67d2..35b442ab 100644 --- a/router.go +++ b/router.go @@ -612,9 +612,9 @@ func (p *ControllerRegistor) ServeHTTP(rw http.ResponseWriter, r *http.Request) if l, ok := p.filters[pos]; ok { for _, filterR := range l { if ok, p := filterR.ValidRouter(urlPath); ok { - for k, v := range context.Input.Params { - p[k] = v - } + for k, v := range context.Input.Params { + p[k] = v + } context.Input.Params = p filterR.filterFunc(context) if filterR.returnOnOutput && w.started {