From eab2b81be2a81422b829e7ef167de7b284695c28 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Thu, 7 Mar 2024 12:46:15 +0100 Subject: [unicode-headers] allow utf-8 in headers + add test for object metadata --- src/api/signature/payload.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/api/signature') diff --git a/src/api/signature/payload.rs b/src/api/signature/payload.rs index d72736bb..d6ff62f0 100644 --- a/src/api/signature/payload.rs +++ b/src/api/signature/payload.rs @@ -331,8 +331,8 @@ pub fn canonical_request( .map(|name| { let value = headers .get(name) - .ok_or_bad_request(format!("signed header `{}` is not present", name))? - .to_str()?; + .ok_or_bad_request(format!("signed header `{}` is not present", name))?; + let value = std::str::from_utf8(value.as_bytes())?; Ok(format!("{}:{}", name.as_str(), value.trim())) }) .collect::, Error>>()? -- cgit v1.2.3