From a778ba476470f55e073776b4ba4756c6a3cabf30 Mon Sep 17 00:00:00 2001 From: 0x676e67 Date: Sat, 11 Oct 2025 18:05:32 +0800 Subject: [PATCH] perf(client): avoid redundant memory copies of Host header --- src/client/legacy/client.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/legacy/client.rs b/src/client/legacy/client.rs index c6dc778..1ec3c52 100644 --- a/src/client/legacy/client.rs +++ b/src/client/legacy/client.rs @@ -302,7 +302,7 @@ where let hostname = uri.host().expect("authority implies host"); if let Some(port) = get_non_default_port(&uri) { let s = format!("{hostname}:{port}"); - HeaderValue::from_str(&s) + HeaderValue::from_maybe_shared(bytes::Bytes::from(s)) } else { HeaderValue::from_str(hostname) }