Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
rzo1 committed Mar 26, 2024
1 parent 37fad09 commit e6d2b4d
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,9 @@ protected void readHeadersFrame(int streamId, int flags, int payloadSize, ByteBu

swallowPayload(streamId, FrameType.HEADERS.getId(), padLength, true, buffer);

// Validate the headers so far
hpackDecoder.getHeaderEmitter().validateHeaders();

if (Flags.isEndOfHeaders(flags)) {
onHeadersComplete(streamId);
} else {
Expand Down Expand Up @@ -467,6 +470,9 @@ protected void readContinuationFrame(int streamId, int flags, int payloadSize, B

readHeaderPayload(streamId, payloadSize, buffer);

// Validate the headers so far
hpackDecoder.getHeaderEmitter().validateHeaders();

if (endOfHeaders) {
headersCurrentStream = -1;
onHeadersComplete(streamId);
Expand Down Expand Up @@ -633,11 +639,6 @@ protected void onHeadersComplete(int streamId) throws Http2Exception {
Http2Error.COMPRESSION_ERROR);
}

// Delay validation (and triggering any exception) until this point
// since all the headers still have to be read if a StreamException is
// going to be thrown.
hpackDecoder.getHeaderEmitter().validateHeaders();

synchronized (output) {
output.headersEnd(streamId);

Expand Down

0 comments on commit e6d2b4d

Please sign in to comment.