Function warp::filters::host::exact[][src]

pub fn exact(
    expected: &str
) -> impl Filter<Extract = (), Error = Rejection> + Clone

Creates a Filter that requires a specific authority (target server’s host and port) in the request.

Authority is specified either in the Host header or in the target URI.

Example

use warp::Filter;

let multihost =
    warp::host::exact("foo.com").map(|| "you've reached foo.com")
    .or(warp::host::exact("bar.com").map(|| "you've reached bar.com"));