From e914b68bbedfc96996a41e2fb88fff8cc37e035a Mon Sep 17 00:00:00 2001 From: mostafa Date: Wed, 19 Aug 2026 17:47:19 +0330 Subject: [PATCH] fix: set usePresignedUrl before first S3 connection isUsePresignedUrl() was read by preSignedUrl() before getConnection() ever ran, since the flag was only assigned as a side effect inside getConnection(). Any request path that never opens a real S3 client (e.g. a PROPFIND that only reads cached DB metadata) saw the flag stuck at its default false, so downloadURL/download-url-expiration came back empty even with use_presigned_url configured. Move the assignment into parseParams(), which runs at construction time for every S3 backend (primary storage and external storage), so the flag is correct regardless of whether a connection was ever opened. Fixes https://github.com/nextcloud/server/issues/59249 Signed-off-by: mostafa --- lib/private/Files/ObjectStore/S3ConnectionTrait.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/private/Files/ObjectStore/S3ConnectionTrait.php b/lib/private/Files/ObjectStore/S3ConnectionTrait.php index 3837f0b869f8b..2c7ea1f011480 100644 --- a/lib/private/Files/ObjectStore/S3ConnectionTrait.php +++ b/lib/private/Files/ObjectStore/S3ConnectionTrait.php @@ -75,6 +75,7 @@ protected function parseParams($params) { } $this->params = $params; + $this->usePresignedUrl = $params['use_presigned_url'] ?? false; } public function getBucket() { @@ -113,8 +114,6 @@ public function getConnection() { ) ); - $this->usePresignedUrl = $this->params['use_presigned_url'] ?? false; - $options = [ 'version' => $this->params['version'] ?? 'latest', 'credentials' => $provider,