Merge branch 'master' into cookie-utf8

This commit is contained in:
Douman 2019-03-31 14:58:42 +03:00 committed by GitHub
commit fb4a0bf764
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -39,7 +39,7 @@ pub trait Guard {
fn check(&self, request: &RequestHead) -> bool;
}
/// Return guard that matches if all of the supplied guards.
/// Create guard object for supplied function.
///
/// ```rust
/// use actix_web::{guard, web, App, HttpResponse};
@ -48,7 +48,9 @@ pub trait Guard {
/// App::new().service(web::resource("/index.html").route(
/// web::route()
/// .guard(
/// guard::fn_guard(|req| req.headers().contains_key("content-type")))
/// guard::fn_guard(
/// |req| req.headers()
/// .contains_key("content-type")))
/// .to(|| HttpResponse::MethodNotAllowed()))
/// );
/// }