From 66c3e4261c8c8d6ef7c576418cfde50b92bcb832 Mon Sep 17 00:00:00 2001 From: Bill Fraser Date: Fri, 25 Sep 2026 10:43:27 -0700 Subject: [PATCH] feat: allow getting Host's inner Authority value If I have a `Host`, and need an `Authority`, right now I have to do `Authority::from_str(&host.to_string())` which involves an extra unnecessary string allocation and parse. --- src/common/host.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/common/host.rs b/src/common/host.rs index cb135323..75d2d772 100644 --- a/src/common/host.rs +++ b/src/common/host.rs @@ -20,6 +20,11 @@ impl Host { pub fn port(&self) -> Option { self.0.port_u16() } + + /// Get the Host value, represented as an [`Authority`]. + pub fn authority(&self) -> Authority { + self.0.clone() + } } impl Header for Host {