Skip to content

Incoming HTTP2 bodies should know content_length #1546

Closed
@seanmonstar

Description

@seanmonstar

When receiving a body over HTTP2, the Body::content_length call should be able to say how big it is if the content-length header was present.

Steps to fix

  • Update Kind::H2 variant of Body to include an Option<u64>.
  • Update the Body::h2 constructor to take a secong argument, Option<u64>.
  • Update both proto::h2::client and proto::h2::server to look for and parse a content-length header before calling Body::h2.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-bodyArea: body streaming.A-http2Area: HTTP/2 specific.C-featureCategory: feature. This is adding a new feature.E-easyEffort: easy. A task that would be a great starting point for a new contributor.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions