Module version_adapter
Available on crate features
http and std only.Structs§
- Request
Version Adapter ConnectorServicewhich will adapt the request version if needed.- Request
Version Adapter Layer ConnectorServicelayer which will adapt the request version if needed.- Response
Version Adapt Ctx - Request-derived state, captured before a request is sent, that a response may
need in order to be translated back to the original request
Version. - Response
Version Adapter Servicewhich will adapt the response version to the original request version.- Response
Version Adapter Layer Layerwhich will adapt the response version to the original request version.
Functions§
- adapt_
request_ version - Adapt request to match the provided
Version - adapt_
response_ version - Adapt response to match the provided
Version, usingResponseVersionAdaptCtxcaptured from the original request to translate handshake responses. - ensure_
h1_ host_ header - Ensure an HTTP/1.x request carries a
Hostheader. - ensure_
h2_ or_ h3_ uri_ authority - Ensure an HTTP/2 or HTTP/3 request carries its authority and scheme in the URI.
- ensure_
valid_ h1_ request - Normalize a request so it is a valid HTTP/1.x request: ensure a
Hostheader and collapse multipleCookieheaders into one (RFC 6265 §5.4). - ensure_
valid_ h2_ or_ h3_ request - Normalize a request so it is a valid HTTP/2 or HTTP/3 request: ensure the
authority/scheme live in the URI (for the
:authority/:schemepseudo-headers) and strip the connection-specific headers those versions forbid (RFC 9113 §8.2.2). - ensure_
valid_ request_ for_ version - Normalize
requestso it is valid for it’s configuredversion