From 02717b317cb663b09fd08e128731134f2a879cb9 Mon Sep 17 00:00:00 2001 From: Constantin Piber <59023762+cpiber@users.noreply.github.com> Date: Tue, 19 Aug 2025 22:00:35 +0300 Subject: [PATCH] [#1550] Allow page icons outside authentication (#1577) --- .../main/kotlin/suwayomi/tachidesk/server/JavalinSetup.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/server/src/main/kotlin/suwayomi/tachidesk/server/JavalinSetup.kt b/server/src/main/kotlin/suwayomi/tachidesk/server/JavalinSetup.kt index 12a0bc55..f1c60b66 100644 --- a/server/src/main/kotlin/suwayomi/tachidesk/server/JavalinSetup.kt +++ b/server/src/main/kotlin/suwayomi/tachidesk/server/JavalinSetup.kt @@ -168,9 +168,13 @@ object JavalinSetup { app.beforeMatched { ctx -> val isWebManifest = listOf("site.webmanifest", "manifest.json", "login.html").any { ctx.path().endsWith(it) } + val isPageIcon = + ctx.path().startsWith('/') && + !ctx.path().substring(1).contains('/') && + listOf(".png", ".jpg", ".ico").any { ctx.path().endsWith(it) } val isPreFlight = ctx.method() == HandlerType.OPTIONS - val requiresAuthentication = !isPreFlight && !isWebManifest + val requiresAuthentication = !isPreFlight && !isPageIcon && !isWebManifest if (!requiresAuthentication) { return@beforeMatched }