From f77ed40b5bb089a1cb7817fbfa95acd23f4e6ac3 Mon Sep 17 00:00:00 2001 From: carbotaniuman <41451839+carbotaniuman@users.noreply.github.com> Date: Wed, 1 Jul 2020 14:56:31 -0500 Subject: [PATCH] Clean up some code --- src/main/kotlin/mdnet/base/server/ImageServer.kt | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main/kotlin/mdnet/base/server/ImageServer.kt b/src/main/kotlin/mdnet/base/server/ImageServer.kt index e59b87a..aace2cd 100644 --- a/src/main/kotlin/mdnet/base/server/ImageServer.kt +++ b/src/main/kotlin/mdnet/base/server/ImageServer.kt @@ -85,7 +85,7 @@ class ImageServer(private val cache: DiskLruCache, private val statistics: Atomi } + "/$chapterHash/$fileName" if (LOGGER.isInfoEnabled) { - LOGGER.info("Request for $sanitizedUri received") + LOGGER.info("Request for $sanitizedUri received from ${request.source?.address}") } statistics.getAndUpdate { it.copy(requestsServed = it.requestsServed + 1) @@ -105,10 +105,8 @@ class ImageServer(private val cache: DiskLruCache, private val statistics: Atomi } } - val referer = request.header("Referer") - handled.set(true) - if (referer != null && !referer.startsWith("https://mangadex.org")) { + if (request.header("Referer")?.startsWith("https://mangadex.org") == true) { snapshot?.close() Response(Status.FORBIDDEN) } else if (snapshot != null && imageDatum != null) {