Skip to content

Commit 0ef2cac

Browse files
committed
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>
1 parent 9fd18b2 commit 0ef2cac

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

apps/files_sharing/lib/Controller/ShareController.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,9 @@ public function downloadShare(string $token, ?string $files = null, string $path
401401
}
402402

403403
$davUrl = '/public.php/dav/files/' . $token . $davPath;
404-
$davUrl .= '?' . http_build_query($params);
404+
if (!empty($params)) {
405+
$davUrl .= '?' . http_build_query($params);
406+
}
405407
return new RedirectResponse($this->urlGenerator->getAbsoluteURL($davUrl));
406408
}
407409
}

0 commit comments

Comments
 (0)