Function ajars_actix_web::actix_web::guard::Host [−][src]
pub fn Host<H>(host: H) -> HostGuard where
H: AsRef<str>,
Expand description
Return predicate that matches if request contains specified Host name.
use actix_web::{web, guard::Host, App, HttpResponse}; fn main() { App::new().service( web::resource("/index.html") .guard(Host("www.rust-lang.org")) .to(|| HttpResponse::MethodNotAllowed()) ); }