1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-08-31 00:50:20 +02:00

rename .middleware to .wrap

This commit is contained in:
Nikolay Kim
2019-03-25 13:02:10 -07:00
parent 939d2e745c
commit 86a21c956c
12 changed files with 68 additions and 33 deletions

View File

@@ -37,7 +37,7 @@
//! }
//!
//! fn main() {
//! let app = App::new().middleware(IdentityService::new(
//! let app = App::new().wrap(IdentityService::new(
//! // <- create identity middleware
//! CookieIdentityPolicy::new(&[0; 32]) // <- create cookie session backend
//! .name("auth-cookie")
@@ -179,7 +179,7 @@ pub trait IdentityPolicy: Sized + 'static {
/// use actix_web::middleware::identity::{CookieIdentityPolicy, IdentityService};
///
/// fn main() {
/// let app = App::new().middleware(IdentityService::new(
/// let app = App::new().wrap(IdentityService::new(
/// // <- create identity middleware
/// CookieIdentityPolicy::new(&[0; 32]) // <- create cookie session backend
/// .name("auth-cookie")
@@ -381,7 +381,7 @@ impl CookieIdentityInner {
/// use actix_web::App;
///
/// fn main() {
/// let app = App::new().middleware(IdentityService::new(
/// let app = App::new().wrap(IdentityService::new(
/// // <- create identity middleware
/// CookieIdentityPolicy::new(&[0; 32]) // <- construct cookie policy
/// .domain("www.rust-lang.org")
@@ -473,7 +473,7 @@ mod tests {
fn test_identity() {
let mut srv = test::init_service(
App::new()
.middleware(IdentityService::new(
.wrap(IdentityService::new(
CookieIdentityPolicy::new(&[0; 32])
.domain("www.rust-lang.org")
.name("actix_auth")