1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-20 19:37:03 +00:00

Add Party.ResetRouterFilters

relative to: https://github.com/kataras/iris/issues/1604#issuecomment-680410131
This commit is contained in:
Gerasimos (Makis) Maropoulos
2020-08-26 06:57:36 +03:00
parent 1780d97d44
commit d44b69faed
6 changed files with 191 additions and 25 deletions

View File

@@ -149,14 +149,14 @@ func (router *Router) buildMainHandlerWithFilters(routerFilters map[Party]*Filte
ctx := cPool.Acquire(w, r)
filterExecuted := false
for _, f := range sortedFilters {
for _, f := range sortedFilters { // from subdomain, largest path to shortest.
// fmt.Printf("Sorted filter execution: [%s] [%s]\n", f.Subdomain, f.Path)
if f.Matcher.Match(ctx) {
// fmt.Printf("Matched [%s] and execute [%d] handlers [%s]\n\n", ctx.Path(), len(f.Handlers), context.HandlersNames(f.Handlers))
filterExecuted = true
// execute the final handlers chain.
ctx.Do(f.Handlers)
break
break // and break on first found.
}
}