Skip to content

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

@lovelydinosaur

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.

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