mirror of
https://gitlab.com/mangadex-pub/mangadex_at_home.git
synced 2024-01-19 02:48:37 +00:00
Clean up some code
This commit is contained in:
parent
e4ce51be82
commit
f77ed40b5b
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue