1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-06-25 22:49:21 +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

@ -178,7 +178,7 @@ impl CookieSessionInner {
/// use actix_web::{web, App, HttpResponse, HttpServer};
///
/// fn main() {
/// let app = App::new().middleware(
/// let app = App::new().wrap(
/// CookieSession::signed(&[0; 32])
/// .domain("www.rust-lang.org")
/// .name("actix_session")
@ -323,7 +323,7 @@ mod tests {
fn cookie_session() {
let mut app = test::init_service(
App::new()
.middleware(CookieSession::signed(&[0; 32]).secure(false))
.wrap(CookieSession::signed(&[0; 32]).secure(false))
.service(web::resource("/").to(|ses: Session| {
let _ = ses.set("counter", 100);
"test"
@ -342,7 +342,7 @@ mod tests {
fn cookie_session_extractor() {
let mut app = test::init_service(
App::new()
.middleware(CookieSession::signed(&[0; 32]).secure(false))
.wrap(CookieSession::signed(&[0; 32]).secure(false))
.service(web::resource("/").to(|ses: Session| {
let _ = ses.set("counter", 100);
"test"

View File

@ -31,7 +31,7 @@
//! fn main() -> std::io::Result<()> {
//! # std::thread::spawn(||
//! HttpServer::new(
//! || App::new().middleware(
//! || App::new().wrap(
//! CookieSession::signed(&[0; 32]) // <- create cookie based session middleware
//! .secure(false)
//! )