mirror of
https://github.com/ntex-rs/ntex-extras.git
synced 2025-04-05 13:57:41 +03:00
fix deprecation warning and update multipartr tests
This commit is contained in:
parent
7fdc863607
commit
de001b0f25
2 changed files with 3 additions and 3 deletions
|
@ -1037,7 +1037,7 @@ mod tests {
|
||||||
let mut payload = PayloadBuffer::new(payload);
|
let mut payload = PayloadBuffer::new(payload);
|
||||||
|
|
||||||
assert_eq!(payload.buf.len(), 0);
|
assert_eq!(payload.buf.len(), 0);
|
||||||
lazy(|cx| payload.poll_stream(cx)).await.unwrap();
|
assert!(lazy(|cx| payload.poll_stream(cx)).await.is_err());
|
||||||
assert_eq!(None, payload.read_max(1).unwrap());
|
assert_eq!(None, payload.read_max(1).unwrap());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -105,7 +105,7 @@ impl<Err> CookieSessionInner<Err> {
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Some(expires_in) = self.expires_in {
|
if let Some(expires_in) = self.expires_in {
|
||||||
cookie.set_expires(OffsetDateTime::now() + expires_in);
|
cookie.set_expires(OffsetDateTime::now_utc() + expires_in);
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Some(max_age) = self.max_age {
|
if let Some(max_age) = self.max_age {
|
||||||
|
@ -136,7 +136,7 @@ impl<Err> CookieSessionInner<Err> {
|
||||||
let mut cookie = Cookie::named(self.name.clone());
|
let mut cookie = Cookie::named(self.name.clone());
|
||||||
cookie.set_value("");
|
cookie.set_value("");
|
||||||
cookie.set_max_age(Duration::zero());
|
cookie.set_max_age(Duration::zero());
|
||||||
cookie.set_expires(OffsetDateTime::now() - Duration::days(365));
|
cookie.set_expires(OffsetDateTime::now_utc() - Duration::days(365));
|
||||||
|
|
||||||
let val = HeaderValue::from_str(&cookie.to_string()).unwrap();
|
let val = HeaderValue::from_str(&cookie.to_string()).unwrap();
|
||||||
res.headers_mut().append(SET_COOKIE, val);
|
res.headers_mut().append(SET_COOKIE, val);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue