Skip to content

Update FileCallbackResult.cs #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: net6-ziparchive
Choose a base branch
from

Conversation

natalie-o-perret
Copy link

A smol' MR changing the stream passed to the callback:

  • from the "Response Body Stream"
  • to the "Response Body Writer property as a stream"
    as the former could trigger "Synchronous operations are disallowed" exceptions with Kestrel (and one doesn't necessarily wanna enable that support).

@brunomartinspro
Copy link

brunomartinspro commented Apr 11, 2024

Thanks! this workaround avoided the

 var syncIOFeature = HttpContext.Features.Get<IHttpBodyControlFeature>();
 
 if (syncIOFeature != null)
 {
     syncIOFeature.AllowSynchronousIO = true;
 }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants