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

Handle HTTP/1.1 half-closed connections gracefully. #723

Closed
tomchristie opened this issue Jun 14, 2023 · 0 comments · Fixed by #641
Closed

Handle HTTP/1.1 half-closed connections gracefully. #723

tomchristie opened this issue Jun 14, 2023 · 0 comments · Fixed by #641
Labels
enhancement New feature or request

Comments

@tomchristie
Copy link
Member

tomchristie commented Jun 14, 2023

There's an HTTP/1.1 case that can occur where...

  • The client starts sending a request.
  • The server half-closes the connection.
  • The server sends a response, such as an HTTP 413 Content Too Large.

Currently our behaviour here is that we'll see a WriteError occur here and never get a response.
A more graceful behaviour is handle this case, and return the 413 response.

Prompted via encode/httpx#2503.

A follow up question to this will be... is there an equivalent to this for HTTP/2 streams? But let's only consider that once we've dealt with this as a precursor.

@tomchristie tomchristie added the enhancement New feature or request label Jun 14, 2023
@tomchristie tomchristie changed the title Handle half-closed connections gracefully. Handle HTTP/1.1 half-closed connections gracefully. Jul 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant