Skip to content

Commit

Permalink
updated cookie session to update on change
Browse files Browse the repository at this point in the history
  • Loading branch information
Dowwie committed Jun 29, 2019
1 parent 50a9d9e commit 0e05b37
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions actix-session/src/cookie.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ use futures::future::{ok, Future, FutureResult};
use futures::Poll;
use serde_json::error::Error as JsonError;

use crate::Session;
use crate::{Session, SessionStatus};

/// Errors that can occur during handling cookie session
#[derive(Debug, From, Display)]
Expand Down Expand Up @@ -308,10 +308,10 @@ where
Session::set_session(state.into_iter(), &mut req);

Box::new(self.service.call(req).map(move |mut res| {
if let (_status, Some(state)) = Session::get_changes(&mut res) {
res.checked_expr(|res| inner.set_cookie(res, state))
} else {
res
match Session::get_changes(&mut res) {
(SessionStatus::Changed, Some(state)) =>
res.checked_expr(|res| inner.set_cookie(res, state)),
_ => res
}
}))
}
Expand Down

0 comments on commit 0e05b37

Please sign in to comment.