From 1541a141ee497450a450a8ce44a9eb71b23996a8 Mon Sep 17 00:00:00 2001 From: Brian Wigginton Date: Tue, 27 Oct 2015 12:22:18 -0500 Subject: [PATCH 1/2] update docs for context.Abort The docs were a little unclear as to how to use Abort, and how it will affect the current handler. --- context.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/context.go b/context.go index b784c14b..ca868329 100644 --- a/context.go +++ b/context.go @@ -101,10 +101,10 @@ func (c *Context) IsAborted() bool { return c.index >= abortIndex } -// Abort stops the system to continue calling the pending handlers in the chain. -// Let's say you have an authorization middleware that validates if the request is authorized -// if the authorization fails (the password does not match). This method (Abort()) should be called -// in order to stop the execution of the actual handler. +// Abort prevents pending handlers from being called. Note that this will not stop the current execution context. +// Let's say you have an authorization middleware that validates that the current request is authorized. If the +// authorization fails (ex: the password does not match), call Abort to ensure the remaining handlers +// for this request are not called. func (c *Context) Abort() { c.index = abortIndex } From 353fa14750af3091846047c0245f7bfc0450c7d3 Mon Sep 17 00:00:00 2001 From: Brian Wigginton Date: Tue, 27 Oct 2015 12:26:05 -0500 Subject: [PATCH 2/2] additional clarification --- context.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/context.go b/context.go index ca868329..7772b460 100644 --- a/context.go +++ b/context.go @@ -101,7 +101,7 @@ func (c *Context) IsAborted() bool { return c.index >= abortIndex } -// Abort prevents pending handlers from being called. Note that this will not stop the current execution context. +// Abort prevents pending handlers from being called. Note that this will not stop the current handler. // Let's say you have an authorization middleware that validates that the current request is authorized. If the // authorization fails (ex: the password does not match), call Abort to ensure the remaining handlers // for this request are not called.