Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Abort middleware chain correctly for Gin #262

Merged
merged 2 commits into from
May 11, 2023

Conversation

bittrance
Copy link
Contributor

It turns out that Gin defaults to advancing the middleware chain; the Next() method is relevant only if a middleware wants to act after subsequent middlewares have been invoked. The Gin adapter currently does not call Abort() when the errorhandler returns non-nil.

This PR correctly aborts the chain when the errorhandler passes an error response, with test.

@bittrance bittrance requested a review from landerss1 May 11, 2023 08:00
@bittrance bittrance self-assigned this May 11, 2023
Copy link
Member

@simongottschlag simongottschlag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@bittrance bittrance merged commit 8e49935 into main May 11, 2023
8 checks passed
@bittrance bittrance deleted the errorhandler-gin-propagation branch May 11, 2023 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants