update cookie dep

This commit is contained in:
Nikolay Kim 2021-03-06 16:39:37 +06:00
parent 94cc4b8ce1
commit bb3816f002
7 changed files with 19 additions and 16 deletions

View file

@ -22,8 +22,8 @@ default = ["cookie-session"]
cookie-session = ["cookie/secure", "ntex/cookie"]
[dependencies]
ntex = "0.3.2"
cookie = "0.14.2"
ntex = "0.3.5"
cookie = "0.15"
derive_more = "0.99.11"
futures = "0.3.13"
serde = "1.0"

View file

@ -118,8 +118,8 @@ impl<Err> CookieSessionInner<Err> {
let mut jar = CookieJar::new();
match self.security {
CookieSecurity::Signed => jar.signed(&self.key).add(cookie),
CookieSecurity::Private => jar.private(&self.key).add(cookie),
CookieSecurity::Signed => jar.signed_mut(&self.key).add(cookie),
CookieSecurity::Private => jar.private_mut(&self.key).add(cookie),
}
for cookie in jar.delta() {
@ -506,6 +506,9 @@ mod tests {
.expires()
.expect("Expiration is set");
assert!(expires_2 - expires_1 >= Duration::seconds(1));
assert!(
expires_2.datetime().unwrap() - expires_1.datetime().unwrap()
>= Duration::seconds(1)
);
}
}