[unicode-headers] allow utf-8 in headers + add test for object metadata

This commit is contained in:
Alex Auvolat
2024-03-07 12:46:15 +01:00
parent 3168bb34a0
commit eab2b81be2
3 changed files with 112 additions and 5 deletions
+2 -2
View File
@@ -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::<Result<Vec<String>, Error>>()?