-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Closed
Labels
✔️ Resolution: DuplicateResolved as a duplicate of another issueResolved as a duplicate of another issuearea-networkingIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractionsIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractionsbugThis issue describes a behavior which is not expected - a bug.This issue describes a behavior which is not expected - a bug.
Milestone
Description
Describe the bug
WriteLineAsync method of HttpResponseStreamWriter in Asp.Net Core 3.0 can cause the following exception:
InvalidOperationException when attempting to write to the response body – with a message “Synchronous operations are disallowed. Call WriteAsync or set AllowSynchronousIO to true instead.”
.
I think it occurs, because default implementation on TextWriter creates new Task which calls Write method. This method is overriden in HttpResponseStreamWriter and writes to response stream in synchronous way. I guess it is a bug.
I've found an issue #2895 says this one and other methods should be overriden. But as I see, it is delayed.
Expected behavior
To work without setting AllowSynchronousIO = true
or using WriteAsync(line + "\n")
korzh and melnalex
Metadata
Metadata
Assignees
Labels
✔️ Resolution: DuplicateResolved as a duplicate of another issueResolved as a duplicate of another issuearea-networkingIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractionsIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractionsbugThis issue describes a behavior which is not expected - a bug.This issue describes a behavior which is not expected - a bug.