diff options
author | Alex <alex@adnab.me> | 2024-03-07 12:54:07 +0000 |
---|---|---|
committer | Alex <alex@adnab.me> | 2024-03-07 12:54:07 +0000 |
commit | afee8c2207e2c79975734f1c1fea41b8b942aaa4 (patch) | |
tree | d51c5e5b4b7f17522f702d2f31bab54213da8e05 /src/api/signature | |
parent | 3168bb34a0082480660e945f7390a5ecab26c665 (diff) | |
parent | eab2b81be2a81422b829e7ef167de7b284695c28 (diff) | |
download | garage-afee8c2207e2c79975734f1c1fea41b8b942aaa4.tar.gz garage-afee8c2207e2c79975734f1c1fea41b8b942aaa4.zip |
Merge pull request 'allow utf-8 in headers + add test for object metadata' (#763) from unicode-headers into main
Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/763
Diffstat (limited to 'src/api/signature')
-rw-r--r-- | src/api/signature/payload.rs | 4 |
1 files changed, 2 insertions, 2 deletions
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::<Result<Vec<String>, Error>>()? |