mirror of
https://gitlab.com/mangadex-pub/mangadex_at_home.git
synced 2024-11-17 00:22:32 +01:00
Properly close snapshot if referer invalid
This commit is contained in:
parent
d24c061cc6
commit
620a859d5c
@ -105,6 +105,10 @@ class ImageServer(private val cache: DiskLruCache, private val statistics: Atomi
|
|||||||
|
|
||||||
handled.set(true)
|
handled.set(true)
|
||||||
if (referer != null && !referer.startsWith("https://mangadex.org")) {
|
if (referer != null && !referer.startsWith("https://mangadex.org")) {
|
||||||
|
if (snapshot != null) {
|
||||||
|
snapshot.close()
|
||||||
|
}
|
||||||
|
|
||||||
Response(Status.FORBIDDEN)
|
Response(Status.FORBIDDEN)
|
||||||
} else if (snapshot != null && imageDatum != null) {
|
} else if (snapshot != null && imageDatum != null) {
|
||||||
request.handleCacheHit(sanitizedUri, getRc4(rc4Bytes), snapshot, imageDatum)
|
request.handleCacheHit(sanitizedUri, getRc4(rc4Bytes), snapshot, imageDatum)
|
||||||
|
Loading…
Reference in New Issue
Block a user