1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-18 10:27:06 +00:00
This commit is contained in:
Gerasimos (Makis) Maropoulos
2020-08-28 02:22:38 +03:00
parent 39e3911d41
commit 933534574a
3 changed files with 15 additions and 3 deletions

View File

@@ -132,10 +132,18 @@ func overlapRoute(r *Route, next *Route) {
next.BuildHandlers()
nextHandlers := next.Handlers[0:]
isErrorRoutes := r.StatusCode > 0 && next.StatusCode > 0
decisionHandler := func(ctx *context.Context) {
ctx.Next()
if !defaultOverlapFilter(ctx) {
if isErrorRoutes { // fixes issue #1602.
// If it's an error we don't need to reset (see defaultOverlapFilter)
// its status code(!) and its body, we just check if it was proceed or not.
if !ctx.IsStopped() {
return
}
} else if !defaultOverlapFilter(ctx) {
return
}