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

Why http.response.start exists? #445

Closed
Kludex opened this issue Mar 14, 2024 · 1 comment
Closed

Why http.response.start exists? #445

Kludex opened this issue Mar 14, 2024 · 1 comment

Comments

@Kludex
Copy link
Contributor

Kludex commented Mar 14, 2024

I've been wondering... Uvicorn is the only ASGI server that sends http.response.start, and then processes the body. The problem with this approach, is that the successful response may be a lie, if there's an error when processing the body.

And... I was thinking about changing the behavior on Uvicorn.

I was wondering, why do we allow http.response.start to be sent before the body?

@andrewgodwin
Copy link
Member

The idea was to emulate the WSGI behaviour, where you can begin the HTTP response before you then start streaming the body contents (start_response versus the contents of an iterator).

@Kludex Kludex closed this as completed Mar 20, 2024
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