From 492ab246319504974b59c3b8212970d2844d7838 Mon Sep 17 00:00:00 2001 From: Hugo Date: Fri, 23 Aug 2024 18:55:14 +0200 Subject: [PATCH 1/3] docs(client): Link from Connection to handshake (#3742) When reading the documentation for `Connection` it is not entirely obvious how instances of this type are obtained. Add a helpful link, mostly for those less familiar. --- src/client/conn/http1.rs | 2 ++ src/client/conn/http2.rs | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/client/conn/http1.rs b/src/client/conn/http1.rs index 647171e764..ecfe6eb8fb 100644 --- a/src/client/conn/http1.rs +++ b/src/client/conn/http1.rs @@ -48,6 +48,8 @@ pub struct Parts { /// /// In most cases, this should just be spawned into an executor, so that it /// can process incoming and outgoing messages, notice hangups, and the like. +/// +/// Instances of this type are typically created via the [`handshake`] function #[must_use = "futures do nothing unless polled"] pub struct Connection where diff --git a/src/client/conn/http2.rs b/src/client/conn/http2.rs index ce86c6dcb4..3db28957b6 100644 --- a/src/client/conn/http2.rs +++ b/src/client/conn/http2.rs @@ -37,6 +37,8 @@ impl Clone for SendRequest { /// /// In most cases, this should just be spawned into an executor, so that it /// can process incoming and outgoing messages, notice hangups, and the like. +/// +/// Instances of this type are typically created via the [`handshake`] function #[must_use = "futures do nothing unless polled"] pub struct Connection where From b990031677b6ffdd958b2c711b9cf27e192f77c0 Mon Sep 17 00:00:00 2001 From: Amos Wenger Date: Mon, 26 Aug 2024 20:18:15 +0200 Subject: [PATCH 2/3] docs(changelog): typo Must not => Must now (#3745) --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5f8c90a3f8..f715e37864 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -212,7 +212,7 @@ Be sure to check out the [upgrading guide](https://hyper.rs/guides/1/upgrading). #### Breaking Changes -* Any IO transport type provided must not implement `hyper::rt::{Read, Write}` instead of +* Any IO transport type provided must now implement `hyper::rt::{Read, Write}` instead of `tokio::io` traits. You can grab a helper type from `hyper-util` to wrap Tokio types, or implement the traits yourself, if it's a custom type. ([f9f65b7a](https://github.com/hyperium/hyper/commit/f9f65b7aa67fa3ec0267fe015945973726285bc2)) From 67a4a498d8bbdce4e604bc578da4693fb048f83d Mon Sep 17 00:00:00 2001 From: Sabrina Jewson Date: Thu, 29 Aug 2024 02:18:40 +0100 Subject: [PATCH 3/3] fix(http2): strip content-length header in response to CONNECT requests (#3748) s --- src/proto/h2/server.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/proto/h2/server.rs b/src/proto/h2/server.rs index ee2d08eaaf..be897a54cf 100644 --- a/src/proto/h2/server.rs +++ b/src/proto/h2/server.rs @@ -485,6 +485,13 @@ where me.reply.send_reset(h2::Reason::INTERNAL_ERROR); return Poll::Ready(Err(crate::Error::new_user_header())); } + if res + .headers_mut() + .remove(::http::header::CONTENT_LENGTH) + .is_some() + { + warn!("successful response to CONNECT request disallows content-length header"); + } let send_stream = reply!(me, res, false); connect_parts.pending.fulfill(Upgraded::new( H2Upgraded {