Skip to content

hyper-util: Add a version of conn::auto that doesn't need to read the version #3511

@sfackler

Description

@sfackler

Is your feature request related to a problem? Please describe.
The current conn::auto::Connection future always internally determines the appropriate protocol version to use. However, this decision should have already been made by ALPN when running over TLS (or via prior knowledge), so the ReadVersion logic ends up adding some overhead and allows bad clients to use an HTTP version they didn't negotiate.

Describe the solution you'd like
I'd like a version of Connection that's essentially just an enum of the h1 and h2 Connection futures and has to be explicitly told which to use, like the http2_only and http1_only methods in 0.14.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-serverArea: server.C-featureCategory: feature. This is adding a new feature.E-mediumEffort: medium. Some knowledge of how hyper internal works would be useful.K-hyper-utilCrate: hyper-util

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions