Skip to content

Commit

Permalink
filter out empty headers - resolves #53 (#65)
Browse files Browse the repository at this point in the history
Fixes issues tpyo#157 & tpyo#171.

It turns out that ListBuckets does not work on non-amazon services due to a 403 SignatureDoesNotMatch error caused by the empty headers.

Co-authored-by: dcmexy <dcmexy@github.com>
  • Loading branch information
macbre and dcmexy authored Sep 10, 2024
1 parent a1478e5 commit 3151e79
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion S3.php
Original file line number Diff line number Diff line change
Expand Up @@ -2004,7 +2004,7 @@ public static function __getSignatureV4($amzHeaders, $headers, $method, $uri, $p

// CanonicalHeaders
foreach ($headers as $k => $v)
$combinedHeaders[strtolower($k)] = trim($v);
if (!empty($v)) $combinedHeaders[strtolower($k)] = trim($v);
foreach ($amzHeaders as $k => $v)
$combinedHeaders[strtolower($k)] = trim($v);
uksort($combinedHeaders, array('S3', '__sortMetaHeadersCmp'));
Expand Down

0 comments on commit 3151e79

Please sign in to comment.