diff --git a/crates/core/src/routing/router.rs b/crates/core/src/routing/router.rs index 03b4d3495..8422b161b 100644 --- a/crates/core/src/routing/router.rs +++ b/crates/core/src/routing/router.rs @@ -257,6 +257,14 @@ impl Router { self.filter(filters::host(host)) } + /// Create a new [`HostFilter`] and set host filter. + /// + /// [`HostFilter`]: super::filters::HostFilter + #[inline] + pub fn with_host(self, host: impl Into) -> Self { + Router::with_filter(filters::host(host)) + } + /// Add a [`PortFilter`] to current router. /// /// [`PortFilter`]: super::filters::PortFilter