Skip to content

HTTP/3: Return H3_FRAME_UNEXPECTED protocol error for unexpected frames #29617

Closed
@JamesNK

Description

@JamesNK

Spec says that Kestrel should return H3_FRAME_UNEXPECTED protocol error for unexpected frames

https://tools.ietf.org/html/draft-ietf-quic-http-33#section-4.1

Currently doing:

private Task ProcessHttp3Stream<TContext>(IHttpApplication<TContext> application, in ReadOnlySequence<byte> payload) where TContext : notnull
{
switch (_incomingFrame.Type)
{
case Http3FrameType.Data:
return ProcessDataFrameAsync(payload);
case Http3FrameType.Headers:
return ProcessHeadersFrameAsync(application, payload);
// need to be on control stream
case Http3FrameType.DuplicatePush:
case Http3FrameType.PushPromise:
case Http3FrameType.Settings:
case Http3FrameType.GoAway:
case Http3FrameType.CancelPush:
case Http3FrameType.MaxPushId:
throw new Http3ConnectionException("HTTP_FRAME_UNEXPECTED");
default:
return ProcessUnknownFrameAsync();
}
}

Also check other places where Kestrel processes frame types.

Metadata

Metadata

Assignees

Labels

HTTP3area-networkingIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions