From 02d512f3fd3bf78b1a0efe410c0704565cab6470 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Fri, 19 Feb 2021 12:38:22 +0100 Subject: [PATCH] Fix #28, extra headers being ignored (because of profound stupidity) --- src/api/s3_get.rs | 2 ++ src/api/s3_put.rs | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/api/s3_get.rs b/src/api/s3_get.rs index 1a23f47..68e7c66 100644 --- a/src/api/s3_get.rs +++ b/src/api/s3_get.rs @@ -16,6 +16,8 @@ fn object_headers( version: &ObjectVersion, version_meta: &ObjectVersionMeta, ) -> http::response::Builder { + debug!("Version meta: {:?}", version_meta); + let date = UNIX_EPOCH + Duration::from_millis(version.timestamp); let date_str = httpdate::fmt_http_date(date); diff --git a/src/api/s3_put.rs b/src/api/s3_put.rs index 656d84a..8ad17cf 100644 --- a/src/api/s3_put.rs +++ b/src/api/s3_put.rs @@ -33,6 +33,8 @@ pub async fn handle_put( // Retrieve interesting headers from request let headers = get_headers(&req)?; + debug!("Object headers: {:?}", headers); + let content_md5 = match req.headers().get("content-md5") { Some(x) => Some(x.to_str()?.to_string()), None => None, @@ -578,7 +580,7 @@ fn get_headers(req: &Request) -> Result { } Ok(ObjectVersionHeaders { content_type, - other: BTreeMap::new(), + other, }) }