Skip to content
Open
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 @@ -180,6 +180,10 @@ private void handleHttpRespCall(ChannelHandlerContext ctx, PostRequest request)

PluginFilterChain chain = conf.getChain();

// here we pre-read parameters in the resp to
// prevent confusion over the read/write index of the resp.
preReadPostReq();

if (Objects.isNull(chain) || 0 == chain.getFilters().size()) {
ChannelFuture future = ctx.writeAndFlush(postResp);
future.addListeners(ChannelFutureListener.FIRE_EXCEPTION_ON_FAILURE);
Expand Down Expand Up @@ -328,6 +332,11 @@ private void preReadReq() {
currReq.getSourceIP();
}

private void preReadPostReq() {
postReq.getUpstreamHeaders();
postReq.getUpstreamStatusCode();
}

private void errorHandle(ChannelHandlerContext ctx, int code) {
A6ErrResponse errResponse = new A6ErrResponse(code);
ctx.writeAndFlush(errResponse);
Expand Down