aboutsummaryrefslogtreecommitdiff
path: root/src/api/signature/payload.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2024-02-07 14:48:27 +0100
committerAlex Auvolat <alex@adnab.me>2024-02-07 14:48:27 +0100
commita31d1bd4969654e6041070b6e80ae025925808c2 (patch)
treebc919a231b47f8bc454a3d058bd15b4107f89154 /src/api/signature/payload.rs
parente524e7a30d4d81c84f1c110017ad972dc5617bf6 (diff)
downloadgarage-a31d1bd4969654e6041070b6e80ae025925808c2.tar.gz
garage-a31d1bd4969654e6041070b6e80ae025925808c2.zip
[dep-upgrade-202402] fix obsolete DateTime::from_utc calls
Diffstat (limited to 'src/api/signature/payload.rs')
-rw-r--r--src/api/signature/payload.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/api/signature/payload.rs b/src/api/signature/payload.rs
index 652c606e..423aad93 100644
--- a/src/api/signature/payload.rs
+++ b/src/api/signature/payload.rs
@@ -1,6 +1,6 @@
use std::collections::HashMap;
-use chrono::{DateTime, Duration, NaiveDateTime, Utc};
+use chrono::{DateTime, Duration, NaiveDateTime, TimeZone, Utc};
use hmac::Mac;
use hyper::{body::Incoming as IncomingBody, Method, Request};
use sha2::{Digest, Sha256};
@@ -316,7 +316,7 @@ fn canonical_query_string(uri: &hyper::Uri) -> String {
pub fn parse_date(date: &str) -> Result<DateTime<Utc>, Error> {
let date: NaiveDateTime =
NaiveDateTime::parse_from_str(date, LONG_DATETIME).ok_or_bad_request("Invalid date")?;
- Ok(DateTime::from_utc(date, Utc))
+ Ok(Utc.from_utc_datetime(&date))
}
pub async fn verify_v4(