aspnetcore
aspnetcore copied to clipboard
`IHttpRequestBodyDetectionFeature` for HTTP/3 GET requests
IHttpRequestBodyDetectionFeature for HTTP/3 GET requests
IHttpRequestBodyDetectionFeature returns false for HTTP/3 (bodyless) GET requests
Description
- Implementation follows the HTTP/2 structure.
- Updated
IHttpRequestBodyDetectionFeatureto include HTTP/3 descriptions for theEND_STREAMflag. - In
Http3Streammodified request body handling logic to return zero length content body instance when there endstream flag is set. It also completes the message body for empty requests, so that theRequestBodyPipe.Readeris closed (needs to be closed, so that when the stream is reused by the pool, the Pipe is reset which requires closed reader) - not sure if this is the best place to do this. - Added unit test
CanHaveBody_ReturnsFalseWithoutRequestBodyto validate behavior when no request body is present.
Fixes #58753
It also completes the message body for empty requests, so that the RequestBodyPipe.Reader is closed (needs to be closed, so that when the stream is reused by the pool, the Pipe is reset which requires closed reader) - not sure if this is the best place to do this.
Http2Stream doesn't do this. It relies on the calling code the cleanup the MessageBody. Is there a reason this is different from the Http2Stream impl?
@BrennanConroy - I will follow up on that.
@BrennanConroy I addressed your concern.
@BrennanConroy could you review the changes?