[#1550] Allow page icons outside authentication (#1577)

This commit is contained in:
Constantin Piber
2025-08-19 22:00:35 +03:00
committed by GitHub
parent 7fa1250a67
commit 02717b317c
@@ -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
}