Skip to main content

Module version_adapter

Module version_adapter 

Available on crate features http and std only.

Structs§

RequestVersionAdapter
ConnectorService which will adapt the request version if needed.
RequestVersionAdapterLayer
ConnectorService layer which will adapt the request version if needed.
ResponseVersionAdaptCtx
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.
ResponseVersionAdapter
Service which will adapt the response version to the original request version.
ResponseVersionAdapterLayer
Layer which 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, using ResponseVersionAdaptCtx captured from the original request to translate handshake responses.
ensure_h1_host_header
Ensure an HTTP/1.x request carries a Host header.
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 Host header and collapse multiple Cookie headers 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/:scheme pseudo-headers) and strip the connection-specific headers those versions forbid (RFC 9113 §8.2.2).
ensure_valid_request_for_version
Normalize request so it is valid for it’s configured version