Closing the connection if frames that carry headers don't have the

END_HEADERS flag.
This commit is contained in:
Simone Bordet 2014-06-24 10:53:21 +02:00
parent 8016fb6d0f
commit 7625844dff
2 changed files with 17 additions and 0 deletions

View File

@ -78,7 +78,15 @@ public class HeadersBodyParser extends BodyParser
{ {
return notifyConnectionFailure(ErrorCode.PROTOCOL_ERROR, "invalid_headers_frame"); 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(); length = getBodyLength();
if (isPaddingHigh()) if (isPaddingHigh())
{ {
state = State.PADDING_HIGH; state = State.PADDING_HIGH;

View File

@ -21,6 +21,7 @@ package org.eclipse.jetty.http2.parser;
import java.nio.ByteBuffer; import java.nio.ByteBuffer;
import org.eclipse.jetty.http.MetaData; import org.eclipse.jetty.http.MetaData;
import org.eclipse.jetty.http2.frames.Flag;
import org.eclipse.jetty.http2.frames.PushPromiseFrame; import org.eclipse.jetty.http2.frames.PushPromiseFrame;
public class PushPromiseBodyParser extends BodyParser public class PushPromiseBodyParser extends BodyParser
@ -62,7 +63,15 @@ public class PushPromiseBodyParser extends BodyParser
{ {
return notifyConnectionFailure(ErrorCode.PROTOCOL_ERROR, "invalid_push_promise_frame"); 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(); length = getBodyLength();
if (isPaddingHigh()) if (isPaddingHigh())
{ {
state = State.PADDING_HIGH; state = State.PADDING_HIGH;