diff --git a/ntex-multipart/src/server.rs b/ntex-multipart/src/server.rs index f1c6df82..fea0f6c3 100644 --- a/ntex-multipart/src/server.rs +++ b/ntex-multipart/src/server.rs @@ -1037,7 +1037,7 @@ mod tests { let mut payload = PayloadBuffer::new(payload); 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()); } diff --git a/ntex-session/src/cookie.rs b/ntex-session/src/cookie.rs index ad634900..15ea2b52 100644 --- a/ntex-session/src/cookie.rs +++ b/ntex-session/src/cookie.rs @@ -105,7 +105,7 @@ impl CookieSessionInner { } 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 { @@ -136,7 +136,7 @@ impl CookieSessionInner { let mut cookie = Cookie::named(self.name.clone()); cookie.set_value(""); 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(); res.headers_mut().append(SET_COOKIE, val);