From 048be29fcde9938aecc07ae0849b9b326908e922 Mon Sep 17 00:00:00 2001 From: astaxie Date: Sun, 22 Sep 2013 11:17:18 +0800 Subject: [PATCH] add w.started fix #208 --- router.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/router.go b/router.go index 54c60009..211da029 100644 --- a/router.go +++ b/router.go @@ -316,6 +316,9 @@ func (p *ControllerRegistor) ServeHTTP(rw http.ResponseWriter, r *http.Request) for _, filterR := range l { if filterR.ValidRouter(r.URL.Path) { filterR.filterFunc(context) + if w.started { + return + } } } } @@ -351,6 +354,9 @@ func (p *ControllerRegistor) ServeHTTP(rw http.ResponseWriter, r *http.Request) for _, filterR := range l { if filterR.ValidRouter(r.URL.Path) { filterR.filterFunc(context) + if w.started { + return + } } } } @@ -423,6 +429,9 @@ func (p *ControllerRegistor) ServeHTTP(rw http.ResponseWriter, r *http.Request) for _, filterR := range l { if filterR.ValidRouter(r.URL.Path) { filterR.filterFunc(context) + if w.started { + return + } } } } @@ -572,6 +581,9 @@ func (p *ControllerRegistor) ServeHTTP(rw http.ResponseWriter, r *http.Request) for _, filterR := range l { if filterR.ValidRouter(r.URL.Path) { filterR.filterFunc(context) + if w.started { + return + } } } } @@ -614,6 +626,9 @@ func (p *ControllerRegistor) ServeHTTP(rw http.ResponseWriter, r *http.Request) for _, filterR := range l { if filterR.ValidRouter(r.URL.Path) { filterR.filterFunc(context) + if w.started { + return + } } } } @@ -665,6 +680,9 @@ func (p *ControllerRegistor) ServeHTTP(rw http.ResponseWriter, r *http.Request) for _, filterR := range l { if filterR.ValidRouter(r.URL.Path) { filterR.filterFunc(context) + if w.started { + return + } } } }