Rollback stuff

This commit is contained in:
carbotaniuman 2020-07-04 17:51:07 -05:00
parent 9c81c415cd
commit 36ca9347f8
2 changed files with 3 additions and 12 deletions

View file

@ -55,8 +55,6 @@ import mdnet.cache.CachingInputStream
import mdnet.cache.DiskLruCache import mdnet.cache.DiskLruCache
import org.http4k.core.* import org.http4k.core.*
import org.http4k.filter.CachingFilters import org.http4k.filter.CachingFilters
import org.http4k.filter.CorsPolicy
import org.http4k.filter.ServerFilters
import org.http4k.lens.Path import org.http4k.lens.Path
import org.jetbrains.exposed.sql.Database import org.jetbrains.exposed.sql.Database
import org.jetbrains.exposed.sql.SchemaUtils import org.jetbrains.exposed.sql.SchemaUtils
@ -279,17 +277,12 @@ class ImageServer(
private fun baseHandler(): Filter = private fun baseHandler(): Filter =
CachingFilters.Response.MaxAge(Clock.systemUTC(), Constants.MAX_AGE_CACHE) CachingFilters.Response.MaxAge(Clock.systemUTC(), Constants.MAX_AGE_CACHE)
.then(ServerFilters.Cors(
CorsPolicy(
origins = listOf("https://mangadex.org"),
headers = listOf("*"),
methods = Method.values().toList()
)
)
)
.then(Filter { next: HttpHandler -> .then(Filter { next: HttpHandler ->
{ request: Request -> { request: Request ->
val response = next(request) val response = next(request)
response.header("access-control-allow-origin", "https://mangadex.org")
response.header("access-control-allow-headers", "*")
response.header("access-control-allow-headers", "GET")
response.header("timing-allow-origin", "https://mangadex.org") response.header("timing-allow-origin", "https://mangadex.org")
} }
}) })

View file

@ -1,7 +1,5 @@
<configuration> <configuration>
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> <appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<immediateFlush>false</immediateFlush>
<filter class="ch.qos.logback.classic.filter.ThresholdFilter"> <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>${file-level:-TRACE}</level> <level>${file-level:-TRACE}</level>
</filter> </filter>