From e98ec3c64cd8aa76246d96eb2c555fbfce463544 Mon Sep 17 00:00:00 2001 From: nfebe Date: Thu, 23 Apr 2026 05:57:52 +0100 Subject: [PATCH] fix(files_sharing): Drop trailing '?' from public download redirect URL Public share download links now redirect to the public DAV endpoint cleanly when no additional query parameters are present. Previously the redirect always appended a trailing '?' to the target URL, which caused an Internal Server Error for clients that called the legacy download endpoint without query parameters (e.g. the Thunderbird FileLink extension). Links shared before this change are resolvable again. Signed-off-by: nfebe --- apps/files_sharing/lib/Controller/ShareController.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/files_sharing/lib/Controller/ShareController.php b/apps/files_sharing/lib/Controller/ShareController.php index bc078cb0b2bde..99499ca5769ec 100644 --- a/apps/files_sharing/lib/Controller/ShareController.php +++ b/apps/files_sharing/lib/Controller/ShareController.php @@ -430,7 +430,9 @@ public function downloadShare($token, $files = null, $path = '') { } $davUrl = '/public.php/dav/files/' . $token . $davPath; - $davUrl .= '?' . http_build_query($params); + if (!empty($params)) { + $davUrl .= '?' . http_build_query($params); + } return new RedirectResponse($this->urlGenerator->getAbsoluteURL($davUrl)); } }