From cc3bfd6faf4b00d2f732e4724d408a8667f0668f Mon Sep 17 00:00:00 2001 From: Sam Rijs Date: Sun, 16 Apr 2023 17:22:47 +0200 Subject: [PATCH 1/2] use HeaderName::from_static in Send::check_headers --- src/proto/streams/send.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/proto/streams/send.rs b/src/proto/streams/send.rs index 20aba38d4..cc1357ebe 100644 --- a/src/proto/streams/send.rs +++ b/src/proto/streams/send.rs @@ -82,8 +82,8 @@ impl Send { if fields.contains_key(http::header::CONNECTION) || fields.contains_key(http::header::TRANSFER_ENCODING) || fields.contains_key(http::header::UPGRADE) - || fields.contains_key("keep-alive") - || fields.contains_key("proxy-connection") + || fields.contains_key(http::HeaderName::from_static("keep-alive")) + || fields.contains_key(http::HeaderName::from_static("proxy-connection")) { tracing::debug!("illegal connection-specific headers found"); return Err(UserError::MalformedHeaders); From 70956bef5afc4b6f46e099069efdf80a1b13a7bc Mon Sep 17 00:00:00 2001 From: Sam Rijs Date: Sun, 16 Apr 2023 19:03:53 +0200 Subject: [PATCH 2/2] make change compatible with older versions of http crate --- src/proto/streams/send.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/proto/streams/send.rs b/src/proto/streams/send.rs index cc1357ebe..55a9ba11d 100644 --- a/src/proto/streams/send.rs +++ b/src/proto/streams/send.rs @@ -82,8 +82,8 @@ impl Send { if fields.contains_key(http::header::CONNECTION) || fields.contains_key(http::header::TRANSFER_ENCODING) || fields.contains_key(http::header::UPGRADE) - || fields.contains_key(http::HeaderName::from_static("keep-alive")) - || fields.contains_key(http::HeaderName::from_static("proxy-connection")) + || fields.contains_key(http::header::HeaderName::from_static("keep-alive")) + || fields.contains_key(http::header::HeaderName::from_static("proxy-connection")) { tracing::debug!("illegal connection-specific headers found"); return Err(UserError::MalformedHeaders);