From 47fc23fc2547c37334869c543a7a9343fd9ca7e9 Mon Sep 17 00:00:00 2001 From: pumuckly Date: Tue, 22 Oct 2024 15:47:28 +0200 Subject: [PATCH] Update ServiceApiController.php The getFavicon throw an exception when the NextCloud service is not serving on the default port. This bugfix remove the port numbers from the domain before prepare the real filename. --- src/lib/Controller/Api/ServiceApiController.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib/Controller/Api/ServiceApiController.php b/src/lib/Controller/Api/ServiceApiController.php index e01799fc..6dfb0b6c 100644 --- a/src/lib/Controller/Api/ServiceApiController.php +++ b/src/lib/Controller/Api/ServiceApiController.php @@ -141,6 +141,7 @@ public function getAvatar(string $user, int $size = 32): FileDisplayResponse { #[NoCSRFRequired] #[NoAdminRequired] public function getFavicon(string $domain, int $size = 32): FileDisplayResponse { + $domain = preg_replace("/\:([0-9]+)\$/",'',$domain); $file = $this->faviconService->getFavicon($domain, $size); return $this->createFileDisplayResponse($file); @@ -258,4 +259,4 @@ protected function validatePreviewSize($size) { throw new ApiException('Invalid dimensions given', Http::STATUS_BAD_REQUEST); } -} \ No newline at end of file +}