EnableBuffering/FileBufferingReadStream doesn't support 0-byte reads #41287
Labels
area-networking
Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions
bug
This issue describes a behavior which is not expected - a bug.
Milestone
Is there an existing issue for this?
Describe the bug
The 0-byte read pattern does not work with FileBufferingReadStream.
On first read with a zero-length buffer it returns 0, but that causes the stream to think it's completely buffered and to stop reading from the inner stream.
aspnetcore/src/Http/WebUtilities/src/FileBufferingReadStream.cs
Lines 387 to 394 in c9af606
Expected Behavior
0-byte reads should return 0, but subsequent reads should still return data.
Steps To Reproduce
Exceptions (if any)
No response
.NET Version
6.0
Anything else?
Discovered by YARP users: dotnet/yarp#1657
The text was updated successfully, but these errors were encountered: