mirror of
https://github.com/deuxfleurs-org/garage.git
synced 2026-07-26 07:58:14 +00:00
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:
Generated
+1
@@ -1548,6 +1548,7 @@ dependencies = [
|
||||
"md-5",
|
||||
"nom",
|
||||
"opentelemetry",
|
||||
"percent-encoding",
|
||||
"pin-project",
|
||||
"quick-xml",
|
||||
"serde",
|
||||
|
||||
@@ -27,6 +27,7 @@ thiserror.workspace = true
|
||||
hex.workspace = true
|
||||
hmac.workspace = true
|
||||
md-5.workspace = true
|
||||
percent-encoding.workspace = true
|
||||
tracing.workspace = true
|
||||
nom.workspace = true
|
||||
pin-project.workspace = true
|
||||
|
||||
@@ -340,7 +340,11 @@ pub fn canonical_request(
|
||||
let canonical_uri: std::borrow::Cow<str> = if service != "s3" {
|
||||
uri_encode(canonical_uri, false).into()
|
||||
} 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
|
||||
|
||||
Reference in New Issue
Block a user