Skip to content

Commit 72bbd22

Browse files
authored
perf(client): avoid redundant memory copies of Host header (#235)
1 parent 1c8f7c6 commit 72bbd22

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/client/legacy/client.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ where
302302
let hostname = uri.host().expect("authority implies host");
303303
if let Some(port) = get_non_default_port(&uri) {
304304
let s = format!("{hostname}:{port}");
305-
HeaderValue::from_str(&s)
305+
HeaderValue::from_maybe_shared(bytes::Bytes::from(s))
306306
} else {
307307
HeaderValue::from_str(hostname)
308308
}

0 commit comments

Comments
 (0)