-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Closed
Closed
Copy link
Labels
area-networkingIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractionsIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractionsfeature-kestrel
Milestone
Description
Is there an existing issue for this?
- I have searched the existing issues
Describe the bug
Unlike with HTTP/2, the HTTP/3 implementation does not check for ReceivedEmptyRequestBody
when creating the message body, which means the body detection feature returns true
even for requests without one.
aspnetcore/src/Servers/Kestrel/Core/src/Internal/Http2/Http2Stream.cs
Lines 194 to 211 in 46ea84f
protected override MessageBody CreateMessageBody() | |
{ | |
if (ReceivedEmptyRequestBody) | |
{ | |
return MessageBody.ZeroContentLengthClose; | |
} | |
if (_messageBody != null) | |
{ | |
_messageBody.Reset(); | |
} | |
else | |
{ | |
_messageBody = new Http2MessageBody(this); | |
} | |
return _messageBody; | |
} |
aspnetcore/src/Servers/Kestrel/Core/src/Internal/Http3/Http3Stream.cs
Lines 947 to 959 in 46ea84f
protected override MessageBody CreateMessageBody() | |
{ | |
if (_messageBody != null) | |
{ | |
_messageBody.Reset(); | |
} | |
else | |
{ | |
_messageBody = new Http3MessageBody(this); | |
} | |
return _messageBody; | |
} |
Expected Behavior
IHttpRequestBodyDetectionFeature
returns false
for requests where it's known from the start that there is no body.
Steps To Reproduce
- Send an HTTP/3 GET request to Kestrel
- Check
IHttpRequestBodyDetectionFeature.CanHaveBody
Exceptions (if any)
N/A
.NET Version
No response
Anything else?
Hit in YARP when downgrading HTTP/3 requests to HTTP/1.1: dotnet/yarp#2644.
Metadata
Metadata
Assignees
Labels
area-networkingIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractionsIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractionsfeature-kestrel