From 7a29384926968a8ba88abb9060dfa840d59ac457 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 8fea0140b35b5..cb12001eb6bb5 100644 --- a/lib/private/Files/ObjectStore/ObjectStoreStorage.php +++ b/lib/private/Files/ObjectStore/ObjectStoreStorage.php @@ -501,7 +501,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), ]; if ($size) { $metadata['size'] = $size;