hyper-util: Add a version of conn::auto that doesn't need to read the version #3511
Labels
A-server
Area: server.
C-feature
Category: feature. This is adding a new feature.
E-medium
Effort: medium. Some knowledge of how hyper internal works would be useful.
K-hyper-util
Crate: hyper-util
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 theReadVersion
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 h2Connection
futures and has to be explicitly told which to use, like thehttp2_only
andhttp1_only
methods in 0.14.The text was updated successfully, but these errors were encountered: