Skip to content
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

Question about example #118

Open
sungam3r opened this issue Jan 7, 2024 · 2 comments
Open

Question about example #118

sungam3r opened this issue Jan 7, 2024 · 2 comments

Comments

@sungam3r
Copy link
Contributor

sungam3r commented Jan 7, 2024

изображение

As I understand the last line always should fail because of context.Response.WriteAsync("Hello "); nothing to do with next() call here, right?

@davidfowl
Copy link
Owner

If previously executed middleware is buffering then it won't fail.

@sungam3r
Copy link
Contributor Author

OK. I understand. My point is about accents in text. Comment says This may fail if next() already wrote to the response focusing reader on next() call but one line above we can see await context.Response.WriteAsync("Hello "); which indeed wrote response regardless any code inside next(). For me line await context.Response.WriteAsync("Hello "); seems confusing and I feel it can be changed to something else (neutral like logging call) or event deleted.

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

No branches or pull requests

2 participants