wip: add percent_decode before uri_encode for check signature

this avoid error when request uri is not encoded for signature
This commit is contained in:
Gwen Lg
2026-03-03 16:44:08 +01:00
committed by Alex
parent 4efaea60bb
commit 3a97b13e2f
3 changed files with 7 additions and 1 deletions
Generated
+1
View File
@@ -1548,6 +1548,7 @@ dependencies = [
"md-5", "md-5",
"nom", "nom",
"opentelemetry", "opentelemetry",
"percent-encoding",
"pin-project", "pin-project",
"quick-xml", "quick-xml",
"serde", "serde",
+1
View File
@@ -27,6 +27,7 @@ thiserror.workspace = true
hex.workspace = true hex.workspace = true
hmac.workspace = true hmac.workspace = true
md-5.workspace = true md-5.workspace = true
percent-encoding.workspace = true
tracing.workspace = true tracing.workspace = true
nom.workspace = true nom.workspace = true
pin-project.workspace = true pin-project.workspace = true
+5 -1
View File
@@ -340,7 +340,11 @@ pub fn canonical_request(
let canonical_uri: std::borrow::Cow<str> = if service != "s3" { let canonical_uri: std::borrow::Cow<str> = if service != "s3" {
uri_encode(canonical_uri, false).into() uri_encode(canonical_uri, false).into()
} else { } else {
canonical_uri.into() //TODO: decode is already do for construct Api::EndPoint, should be better to be able to keep it instead of compute it again.
let key = percent_encoding::percent_decode_str(canonical_uri)
.decode_utf8()
.unwrap();
uri_encode(&key, false).into()
}; };
// Canonical query string from passed HeaderMap // Canonical query string from passed HeaderMap