Skip to content

Commit e42a85a

Browse files
committed
Missing decoder failure handling
1 parent 95ebb7b commit e42a85a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

modules/transport-netty4/src/main/java/org/elasticsearch/http/netty4/Netty4HttpHeaderValidator.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,12 @@ public void read(ChannelHandlerContext ctx) throws Exception {
7878
if (buffer.size() > 0) {
7979
final var message = buffer.pollFirst();
8080
if (message instanceof HttpRequest httpRequest) {
81-
validate(ctx, httpRequest);
81+
if (httpRequest.decoderResult().isFailure()) {
82+
ctx.fireChannelRead(message); // pass-through for decoding failures
83+
ctx.fireChannelReadComplete(); // downstream will have to call read() again when it's ready
84+
} else {
85+
validate(ctx, httpRequest);
86+
}
8287
} else {
8388
assert message instanceof HttpContent;
8489
assert state == State.PASSING : state; // DROPPING releases any buffered chunks up-front

0 commit comments

Comments
 (0)