Skip to content

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

Closed

Description

@lovelydinosaur

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.

Activity

  1. changed the title [-]Handle half-closed connections gracefully.[/-] [+]Handle HTTP/1.1 half-closed connections gracefully.[/+] on Jul 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions