[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
+1 -1
View File
@@ -595,7 +595,7 @@ pub(crate) fn get_headers(headers: &HeaderMap<HeaderValue>) -> Result<ObjectVers
// Preserve x-amz-meta- headers
for (k, v) in headers.iter() {
if k.as_str().starts_with("x-amz-meta-") {
match v.to_str() {
match std::str::from_utf8(v.as_bytes()) {
Ok(v_str) => {
other.insert(k.to_string(), v_str.to_string());
}