Skip to content

Commit

Permalink
[UNDERTOW-2405] The correct error code to be sent if frame parser ref…
Browse files Browse the repository at this point in the history
…uses more data is PROTOCOL_ERROR

This makes this code consistent with the handling of headers that surpass the max header size limit elsewhere in HTTP2 (see Http2HeaderBlockParser.emitHeader), and the justification is that the max header size must have been handshaken with the peer as part of settings frame, via the SETTINGS_HEADER_TABLE_SIZE parameter.

Signed-off-by: Flavia Rainone <frainone@redhat.com>
  • Loading branch information
fl4via committed Jun 18, 2024
1 parent 35c4ed2 commit 6e3ecd9
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import java.nio.ByteBuffer;

import static io.undertow.protocols.http2.Http2Channel.DATA_FLAG_END_STREAM;
import static io.undertow.protocols.http2.Http2Channel.ERROR_ENHANCE_YOUR_CALM;
import static io.undertow.protocols.http2.Http2Channel.FRAME_TYPE_CONTINUATION;
import static io.undertow.protocols.http2.Http2Channel.FRAME_TYPE_DATA;
import static io.undertow.protocols.http2.Http2Channel.FRAME_TYPE_GOAWAY;
Expand Down Expand Up @@ -110,7 +109,7 @@ public boolean handle(final ByteBuffer byteBuffer) throws IOException {
}
parser = continuationParser;
if (!continuationParser.moreData(length)) {
http2Channel.sendGoAway(ERROR_ENHANCE_YOUR_CALM);
http2Channel.sendGoAway(Http2Channel.ERROR_PROTOCOL_ERROR);
}
break;
}
Expand Down

0 comments on commit 6e3ecd9

Please sign in to comment.