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

Do not apply filters when RouteExecutor decides not to handle an error #6745

Merged
merged 1 commit into from Jan 12, 2022

Conversation

yawkat
Copy link
Member

@yawkat yawkat commented Jan 12, 2022

For certain errors (isIgnorable), the RouteExecutor decides not to write a response for the error, and returns an empty flux. However, without this patch, the RoutingInBoundHandler would still apply filters. For example, the micronaut-security filter will check access permissions for the error request, even though those routes would never be executed anyway (RouteExecutor decided not to). That filter may then return a response.

This patch adds a short-circuit check for these 'closed connection' errors to RoutingInBoundHandler, and avoids running downstream processing altogether.

Fixes #6723

For certain errors (`isIgnorable`), the `RouteExecutor` decides not to write a response for the error, and returns an empty flux. However, without this patch, the `RoutingInBoundHandler` would still apply filters. For example, the micronaut-security filter will check access permissions for the error request, even though those routes would never be executed anyway (`RouteExecutor` decided not to). That filter may then return a response.

This patch adds a short-circuit check for these 'closed connection' errors to `RoutingInBoundHandler`, and avoids running downstream processing altogether.

Fixes #6723
@yawkat yawkat added the type: bug Something isn't working label Jan 12, 2022
@graemerocher graemerocher added this to the 3.2.6 milestone Jan 12, 2022
@jameskleeh jameskleeh merged commit 738fe43 into 3.2.x Jan 12, 2022
@jameskleeh jameskleeh deleted the filter-error branch January 12, 2022 14:44
yawkat added a commit that referenced this pull request Jan 21, 2022
#6745)

For certain errors (`isIgnorable`), the `RouteExecutor` decides not to write a response for the error, and returns an empty flux. However, without this patch, the `RoutingInBoundHandler` would still apply filters. For example, the micronaut-security filter will check access permissions for the error request, even though those routes would never be executed anyway (`RouteExecutor` decided not to). That filter may then return a response.

This patch adds a short-circuit check for these 'closed connection' errors to `RoutingInBoundHandler`, and avoids running downstream processing altogether.

Fixes #6723
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
3 participants