aboutsummaryrefslogtreecommitdiff
path: root/src/api/signature/payload.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/api/signature/payload.rs')
-rw-r--r--src/api/signature/payload.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/api/signature/payload.rs b/src/api/signature/payload.rs
index b50fb3bb..423aad93 100644
--- a/src/api/signature/payload.rs
+++ b/src/api/signature/payload.rs
@@ -1,8 +1,8 @@
use std::collections::HashMap;
-use chrono::{DateTime, Duration, NaiveDateTime, Utc};
+use chrono::{DateTime, Duration, NaiveDateTime, TimeZone, Utc};
use hmac::Mac;
-use hyper::{Body, Method, Request};
+use hyper::{body::Incoming as IncomingBody, Method, Request};
use sha2::{Digest, Sha256};
use garage_table::*;
@@ -20,7 +20,7 @@ use crate::signature::error::*;
pub async fn check_payload_signature(
garage: &Garage,
service: &'static str,
- request: &Request<Body>,
+ request: &Request<IncomingBody>,
) -> Result<(Option<Key>, Option<Hash>), Error> {
let mut headers = HashMap::new();
for (key, val) in request.headers() {
@@ -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(