From e45d5efc41143393cb45c04eb6e37567350cd2b2 Mon Sep 17 00:00:00 2001 From: JeiHO Date: Fri, 17 May 2024 14:11:46 -0600 Subject: [PATCH] In a subresource the parameter value will be an empty string. The documentation explains: when a request targets a subresource, the corresponding query parameter value will be an empty string (""). Example: "http://s3.amazonaws.com/examplebucket?acl" The CanonicalQueryString in this case is as follows: UriEncode("acl") + "=" + "" https://docs.aws.amazon.com/IAM/latest/UserGuide/create-signed-request.html#create-canonical-request --- src/Signature/SignatureV4.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Signature/SignatureV4.php b/src/Signature/SignatureV4.php index d13f9c3afc..e0e4297329 100644 --- a/src/Signature/SignatureV4.php +++ b/src/Signature/SignatureV4.php @@ -348,6 +348,11 @@ private function getCanonicalizedQuery(array $query) $qs = ''; ksort($query); foreach ($query as $k => $v) { + if(is_numeric($k)){ + $qs .= rawurlencode((string)$v) . '=&'; + continue; + } + if (!is_array($v)) { $qs .= rawurlencode($k) . '=' . rawurlencode($v !== null ? $v : '') . '&'; } else {