Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(http/upgrade): document
linkerd-http-upgrade
(#3531)
some aspects of `linkerd-http-upgrade` are incompatible with the 1.0 interface of the `http` crate (_see: hyperium/http#395, linkerd/linkerd2#8733_). this new bound requiring that extensions must now be cloneable motivated me to read through this library's internals to gain a lucid understanding of how it works, in order to understand how to gracefully address [this](https://github.com/linkerd/linkerd2-proxy/blob/main/linkerd/http/upgrade/src/upgrade.rs#L25-L26) comment affixed to the `linkerd_http_upgrade::upgrade::Http11Upgrade` request/response extension: ```rust // Note: this relies on their only having been 2 Inner clones, so don't // implement `Clone` for this type. [sic] pub struct Http11Upgrade { half: Half, inner: Arc<Inner>, } ``` broadly, this library deals with some moderately arcane corners of the HTTP protocol family. the `Upgrade` header is not supported in HTTP/2, and was not yet introduced in HTTP/1.0, so it is a feature specific to HTTP/1.1. moreover, some behavior provided by this library falls into parts of the spec(s) that we `MUST` uphold, and isn't currently well documented. this branch includes a sequence of commits adding documentation and additional comments linking to, and quoting, the relevant parts of [RFC 9110](https://www.rfc-editor.org/rfc/rfc9110). some links to RFC 7231, which was obsoleted by RFC 9110 since the original time of writing, are additionally updated. some comments also did not accurately describe internal logic, or included typos, and are also updated. --- * docs(http/upgrade): add crate-level docs, rfc link Signed-off-by: katelyn martin <kate@buoyant.io> * docs(http/upgrade): update link to obsolete rfc rfc 9110 obsoletes the following rfc's: 2818, 7230, 7231, 7232, 7233, 7235, 7538, 7615, and 7694. this updates a comment related to connection upgrade logic, linking to the current rfc, 9110. this information now lives in section 9.3.6, paragraph 12. Signed-off-by: katelyn martin <kate@buoyant.io> * nit(http/upgrade): update incorrect comment this function has since been renamed `halves()`. Signed-off-by: katelyn martin <kate@buoyant.io> * docs(http/upgrade): add comments to `wants_upgrade` this adds a comment additionally clarifying that HTTP/2 does not support upgrades. Signed-off-by: katelyn martin <kate@buoyant.io> * docs(http/upgrade): document `strip_connection_headers()` this function performs some important behavior that we MUST implement, as a proxy/intermediary. to help elucidate the mandated behavior expected of us by the HTTP/1 specification, add documentation comments noting the related passages from rfc 9110 § 7.6.1. Signed-off-by: katelyn martin <kate@buoyant.io> * nit(http/upgrade): fix typo in `Http11Upgrade` comment Signed-off-by: katelyn martin <kate@buoyant.io> * docs(http/upgrade): update incorrect comment this comment is not true. this commit updates it, reflecting the current state of the upgrade body's `Drop` logic. Signed-off-by: katelyn martin <kate@buoyant.io> --------- Signed-off-by: katelyn martin <kate@buoyant.io>
- Loading branch information