From ed93dc1b8e4d0d4b06a90d36d1e11b5837833157 Mon Sep 17 00:00:00 2001 From: Ali Mirghasemi Date: Mon, 23 Feb 2026 09:36:50 +0330 Subject: [PATCH] Add camel-case support for connection upgrade --- actix-http/src/h1/encoder.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/actix-http/src/h1/encoder.rs b/actix-http/src/h1/encoder.rs index 81af7868b..c5d06ed95 100644 --- a/actix-http/src/h1/encoder.rs +++ b/actix-http/src/h1/encoder.rs @@ -111,7 +111,13 @@ pub(crate) trait MessageType: Sized { // Connection match conn_type { - ConnectionType::Upgrade => dst.put_slice(b"connection: upgrade\r\n"), + ConnectionType::Upgrade => { + if camel_case { + dst.put_slice(b"Connection: upgrade\r\n") + } else { + dst.put_slice(b"connection: upgrade\r\n") + } + }, ConnectionType::KeepAlive if version < Version::HTTP_11 => { if camel_case { dst.put_slice(b"Connection: keep-alive\r\n")