lokidundun commented on code in PR #7822:
URL: https://github.com/apache/incubator-seata/pull/7822#discussion_r2627035718
##########
core/src/main/java/org/apache/seata/core/rpc/netty/http/HttpDispatchHandler.java:
##########
@@ -149,16 +152,19 @@ private void sendResponse(ChannelHandlerContext ctx,
boolean keepAlive, Object r
response = new DefaultFullHttpResponse(
HttpVersion.HTTP_1_1, HttpResponseStatus.OK,
Unpooled.wrappedBuffer(Unpooled.EMPTY_BUFFER));
}
+ context.setResponse(response);
if (!keepAlive) {
ctx.writeAndFlush(response).addListeners(ChannelFutureListener.CLOSE);
} else {
ctx.writeAndFlush(response);
}
}
- private void sendErrorResponse(ChannelHandlerContext ctx,
HttpResponseStatus status, boolean keepAlive) {
+ private void sendErrorResponse(
+ ChannelHandlerContext ctx, HttpResponseStatus status, boolean
keepAlive, HttpFilterContext<?> context) {
FullHttpResponse response = new DefaultFullHttpResponse(
HttpVersion.HTTP_1_1, status,
Unpooled.wrappedBuffer(Unpooled.EMPTY_BUFFER));
+ context.setResponse(response);
Review Comment:
Catched! I’ve adjusted setResponse to run before sendErrorResponse, to
ensure AOP can access the response in time.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]