HttpResponseStreamWriter should override TextWriter.WriteLineAsync(string) #38210
Labels
area-networking
Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions
help wanted
Up for grabs. We would accept a PR to help resolve this issue
Milestone
Describe the bug
A clear and concise description of what the bug is.
We have code generating a large response using a
TextWriter
which is an instance ofHttpResponseStreamWriter
. When the response gets large enough, the code starts failing with the following error:Interestingly, our code is failing on the following line:
Digging in deeper, it seems like this fails because
HttpResponseStreamWriter
overridesTextWriter.WriteLineAsync(ReadOnlyMemory<char>, CancellationToken)
andTextWriter.WriteAsync(string)
but notTextWriter.WriteLineAsync(string)
. It is missing a few other async overloads as well.This feels like an oversight; it makes it difficult to properly use the
HttpResponseStreamWriter
for async writes becauseWriteLineAsync(string)
is a gotcha.To Reproduce
Create a controller with the following endpoint:
Exceptions (if any)
Further technical details
dotnet --info
:dotnet --info Output
The text was updated successfully, but these errors were encountered: