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 <fenn25.fn@gmail.com>
This commit is contained in:
nfebe 2026-04-23 05:57:52 +01:00
parent 9fd18b2812
commit 0ef2caccc6

View file

@ -401,7 +401,9 @@ class ShareController extends AuthPublicShareController {
}
$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));
}
}