Describe the bug
The calculation of the signature V4 canonicalized query is wrong for queries when a parameter key occurs multiple times and the parameter values are numeric. This results in a wrong signature.
Regression Issue
Expected Behavior
Correct calculation of the signature according to the standard.
Current Behavior
The signature is calculated wrong.
Reproduction Steps
Use a query which contains numeric parameter values.
E.g. sku=5033400&sku=10000010
Expected result: sku=10000010&sku=5033400
Current result: sku=5033400&sku=10000010
Possible Solution
Generally the SORT_STRING should be added to the corresponding sort function.
It can be found in SignatureV4::getCanonicalizedQuery in line 356.
The change from sort($v); to sort($v, SORT_STRING); resolves the issue.
Additional Information/Context
No response
SDK version used
3.369.9
Environment details (Version of PHP (php -v)? OS name and version, etc.)
PHP 8.3.28
Describe the bug
The calculation of the signature V4 canonicalized query is wrong for queries when a parameter key occurs multiple times and the parameter values are numeric. This results in a wrong signature.
Regression Issue
Expected Behavior
Correct calculation of the signature according to the standard.
Current Behavior
The signature is calculated wrong.
Reproduction Steps
Use a query which contains numeric parameter values.
E.g. sku=5033400&sku=10000010
Expected result: sku=10000010&sku=5033400
Current result: sku=5033400&sku=10000010
Possible Solution
Generally the
SORT_STRINGshould be added to the corresponding sort function.It can be found in
SignatureV4::getCanonicalizedQueryin line 356.The change from
sort($v);tosort($v, SORT_STRING);resolves the issue.Additional Information/Context
No response
SDK version used
3.369.9
Environment details (Version of PHP (
php -v)? OS name and version, etc.)PHP 8.3.28