1
0
mirror of https://github.com/kataras/iris.git synced 2026-01-08 20:41:57 +00:00

fix 2 minor issues

This commit is contained in:
Gerasimos (Makis) Maropoulos
2022-02-26 21:16:08 +02:00
parent 09f494e406
commit 20fa672097
7 changed files with 49 additions and 19 deletions

View File

@@ -75,7 +75,9 @@ func (e ExecutionOptions) buildHandler(h context.Handler) context.Handler {
return func(ctx *context.Context) {
// Proceed will fire the handler and return false here if it doesn't contain a `ctx.Next()`,
// so we add the `ctx.Next()` wherever is necessary in order to eliminate any dev's misuse.
if !ctx.Proceed(h) {
//
// 26 Feb 2022: check if manually stopped, and if it's then don't call ctx.Next.
if hasStopped, hasNext := ctx.ProceedAndReportIfStopped(h); !hasStopped && !hasNext {
// `ctx.Next()` always checks for `ctx.IsStopped()` and handler(s) positions by-design.
ctx.Next()
}