mirror of
https://github.com/fafhrd91/actix-web
synced 2025-06-25 06:39:22 +02:00
rename .middleware to .wrap
This commit is contained in:
@ -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"
|
||||
|
@ -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)
|
||||
//! )
|
||||
|
Reference in New Issue
Block a user