diff --git a/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/parser/HeadersBodyParser.java b/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/parser/HeadersBodyParser.java index 1fd9a0a0393..e6f08b80955 100644 --- a/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/parser/HeadersBodyParser.java +++ b/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/parser/HeadersBodyParser.java @@ -78,7 +78,15 @@ public class HeadersBodyParser extends BodyParser { return notifyConnectionFailure(ErrorCode.PROTOCOL_ERROR, "invalid_headers_frame"); } + + // For now we don't support HEADERS frames that don't have END_HEADERS. + if (!hasFlag(Flag.END_HEADERS)) + { + return notifyConnectionFailure(ErrorCode.INTERNAL_ERROR, "unsupported_headers_frame"); + } + length = getBodyLength(); + if (isPaddingHigh()) { state = State.PADDING_HIGH; diff --git a/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/parser/PushPromiseBodyParser.java b/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/parser/PushPromiseBodyParser.java index dd0a7ae3715..ff81fd662f5 100644 --- a/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/parser/PushPromiseBodyParser.java +++ b/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/parser/PushPromiseBodyParser.java @@ -21,6 +21,7 @@ package org.eclipse.jetty.http2.parser; import java.nio.ByteBuffer; import org.eclipse.jetty.http.MetaData; +import org.eclipse.jetty.http2.frames.Flag; import org.eclipse.jetty.http2.frames.PushPromiseFrame; public class PushPromiseBodyParser extends BodyParser @@ -62,7 +63,15 @@ public class PushPromiseBodyParser extends BodyParser { return notifyConnectionFailure(ErrorCode.PROTOCOL_ERROR, "invalid_push_promise_frame"); } + + // For now we don't support PUSH_PROMISE frames that don't have END_HEADERS. + if (!hasFlag(Flag.END_HEADERS)) + { + return notifyConnectionFailure(ErrorCode.INTERNAL_ERROR, "unsupported_push_promise_frame"); + } + length = getBodyLength(); + if (isPaddingHigh()) { state = State.PADDING_HIGH;