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

GraphQL to terminate the request even if it was active #26934

Merged
merged 1 commit into from
Jul 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -58,22 +58,18 @@ public void handle(Object e) {
@Override
public void handle(final RoutingContext ctx) {

if (currentManagedContext.isActive()) {
handleWithIdentity(ctx);
} else {

ctx.response()
.endHandler(currentManagedContextTerminationHandler)
.exceptionHandler(currentManagedContextTerminationHandler)
.closeHandler(currentManagedContextTerminationHandler);
if (!currentManagedContext.isActive()) {
currentManagedContext.activate();
ctx.response()
.endHandler(currentManagedContextTerminationHandler)
.exceptionHandler(currentManagedContextTerminationHandler)
.closeHandler(currentManagedContextTerminationHandler);

try {
handleWithIdentity(ctx);
} catch (Throwable t) {
currentManagedContext.terminate();
throw t;
}
}
try {
handleWithIdentity(ctx);
} catch (Throwable t) {
currentManagedContext.terminate();
throw t;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,8 @@ private JsonObject getJsonObjectFromBody(RoutingContext ctx) throws IOException
}

private String readBody(RoutingContext ctx) {
if (ctx.getBody() != null) {
return ctx.getBodyAsString();
if (ctx.body() != null) {
return ctx.body().asString();
Comment on lines -199 to +200
Copy link
Member

Choose a reason for hiding this comment

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

Next time, let's avoid to shoe in this type of change in a security fix as this is not backportable to 2.10.

Copy link
Member

Choose a reason for hiding this comment

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

(I fixed it, no need for additional work on your side)

}
return null;
}
Expand Down