Fix webmanifest
This commit is contained in:
parent
cd9fdd28e8
commit
a37254452b
@ -3,9 +3,13 @@ package be.simplenotes.app.filters
|
||||
import org.http4k.core.Filter
|
||||
import org.http4k.core.HttpHandler
|
||||
import org.http4k.core.Request
|
||||
import org.http4k.core.Status.Companion.OK
|
||||
|
||||
object ImmutableFilter : Filter {
|
||||
override fun invoke(next: HttpHandler) = { request: Request ->
|
||||
next(request).header("Cache-Control", "public, max-age=31536000, immutable")
|
||||
val res = next(request)
|
||||
if (res.status == OK)
|
||||
res.header("Cache-Control", "public, max-age=31536000, immutable")
|
||||
else res
|
||||
}
|
||||
}
|
||||
|
||||
@ -32,7 +32,13 @@ class Router(
|
||||
val basicRoutes =
|
||||
routes(
|
||||
"/health" bind GET to healthCheckController::healthCheck,
|
||||
ImmutableFilter.then(static(Classpath("/static"), "woff2" to ContentType("font/woff2")))
|
||||
ImmutableFilter.then(
|
||||
static(
|
||||
Classpath("/static"),
|
||||
"woff2" to ContentType("font/woff2"),
|
||||
"webmanifest" to ContentType("application/manifest+json")
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
val publicRoutes = routes(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user