From 7c39ffe75284c68dbf3918f8e7f4ad4b0904841e Mon Sep 17 00:00:00 2001 From: "Bala.FA" Date: Sat, 17 Aug 2024 07:17:01 +0530 Subject: [PATCH] SignV4: trim leading/trailing spaces in header value Signed-off-by: Bala.FA --- src/s3/utils.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/s3/utils.rs b/src/s3/utils.rs index 6b33155..9cf9716 100644 --- a/src/s3/utils.rs +++ b/src/s3/utils.rs @@ -269,7 +269,7 @@ pub fn get_canonical_headers(map: &Multimap) -> (String, String) { if !value.is_empty() { value.push(','); } - let s: String = MULTI_SPACE_REGEX.replace_all(&v, " ").to_string(); + let s: String = MULTI_SPACE_REGEX.replace_all(&v, " ").trim().to_string(); value.push_str(&s); } btmap.insert(key.clone(), value.clone());