From 07edb22740c97bd03d097de9b95965b541e7e225 Mon Sep 17 00:00:00 2001 From: Kent Delante Date: Wed, 8 Jul 2026 21:02:23 +0800 Subject: [PATCH] fix(s3): trim multiple spaces to single space in original path header Signed-off-by: Kent Delante 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. --- lib/private/Files/ObjectStore/ObjectStoreStorage.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/private/Files/ObjectStore/ObjectStoreStorage.php b/lib/private/Files/ObjectStore/ObjectStoreStorage.php index 036016e1c9766..8ab1622eb9e62 100644 --- a/lib/private/Files/ObjectStore/ObjectStoreStorage.php +++ b/lib/private/Files/ObjectStore/ObjectStoreStorage.php @@ -478,7 +478,7 @@ public function writeStream(string $path, $stream, ?int $size = null): int { $metadata = [ 'mimetype' => $mimetype, 'original-storage' => $this->getId(), - 'original-path' => $path, + 'original-path' => preg_replace('/\s+/', ' ', $path) ?? $path, ]; if ($size) { $metadata['size'] = $size;