Closed
Description
Describe the bug
I'm creating a test server for my application and another testserver for the reverse proxy. When I call the proxy, it should forward the call to the application, but instead, I get the following exception:
System.ArgumentOutOfRangeException
To Reproduce
I've included a test project that gives the error for me.
yarp.zip
Yarp.ReverseProxy.Forwarder.HttpForwarder[48]
ResponseBodyDestination: The destination reported an error when copying the response body.
System.ArgumentOutOfRangeException: (Parameter 'count')
Actual value was 0.
at Microsoft.AspNetCore.TestHost.ResponseBodyReaderStream.VerifyBuffer(Byte[] buffer, Int32 offset, Int32 count)
at Microsoft.AspNetCore.TestHost.ResponseBodyReaderStream.ReadAsync(Byte[] buffer, Int32 offset, Int32 count, CancellationToken cancellationToken)
at Yarp.ReverseProxy.Forwarder.StreamCopier.CopyAsync(Stream input, Stream output, Int64 promisedContentLength, StreamCopierTelemetry telemetry, ActivityCancellationTokenSource activityToken, CancellationToken cancellation)
Further technical details
Yarp 1.1.0
testhost 6.0.5