mirror of
https://github.com/Suwayomi/Suwayomi-Server.git
synced 2026-07-03 19:04:39 -05:00
@@ -168,9 +168,13 @@ object JavalinSetup {
|
|||||||
|
|
||||||
app.beforeMatched { ctx ->
|
app.beforeMatched { ctx ->
|
||||||
val isWebManifest = listOf("site.webmanifest", "manifest.json", "login.html").any { ctx.path().endsWith(it) }
|
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 isPreFlight = ctx.method() == HandlerType.OPTIONS
|
||||||
|
|
||||||
val requiresAuthentication = !isPreFlight && !isWebManifest
|
val requiresAuthentication = !isPreFlight && !isPageIcon && !isWebManifest
|
||||||
if (!requiresAuthentication) {
|
if (!requiresAuthentication) {
|
||||||
return@beforeMatched
|
return@beforeMatched
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user