Skip to content

Commit 3da7826

Browse files
leftybournesAndyScherzinger
authored andcommitted
fix(s3): trim multiple spaces to single space in original path header
Signed-off-by: Kent Delante <kent@delante.me> The spec defines that x-amz-meta-original-path header needs spaces to be trimmed and multiple spaces need to be converted to a single space. This is to comply with the spec and fix it for some storage hosts that return a SignatureDoesNotMatch error when not done.
1 parent 3af8a43 commit 3da7826

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/private/Files/ObjectStore/ObjectStoreStorage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@ public function writeStream(string $path, $stream, ?int $size = null): int {
470470
$metadata = [
471471
'mimetype' => $mimetype,
472472
'original-storage' => $this->getId(),
473-
'original-path' => $path,
473+
'original-path' => preg_replace('/\s+/', ' ', $path) ?? $path,
474474
];
475475
if ($size) {
476476
$metadata['size'] = $size;

0 commit comments

Comments
 (0)