Skip to content

Commit 1849e72

Browse files
authored
Fix forming signature with multiple space (#981)
Ref https://github.com/aws/aws-sdk-php/blob/master/src/Signature/SignatureV4.php#L301 Problem example: ```php $s3->copyObject([ 'Bucket' => 'target', 'Key' => '1.txt', 'CopySource' => 'source/1 2.txt', // double space ]); ```
1 parent 8ff3bfd commit 1849e72

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Signer/SignerV4.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ private function buildCanonicalHeaders(Request $request, bool $isPresign): array
273273
continue;
274274
}
275275

276-
$canonicalHeaders[$key] = "$key:$value";
276+
$canonicalHeaders[$key] = $key . ':' . preg_replace('/\s+/', ' ', $value);
277277
}
278278
ksort($canonicalHeaders);
279279

0 commit comments

Comments
 (0)