1
0
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:
Amos Ng 2020-06-29 06:42:44 +08:00
parent d24c061cc6
commit 620a859d5c
No known key found for this signature in database
GPG Key ID: 89086414F634D123

View File

@ -105,6 +105,10 @@ class ImageServer(private val cache: DiskLruCache, private val statistics: Atomi
handled.set(true)
if (referer != null && !referer.startsWith("https://mangadex.org")) {
if (snapshot != null) {
snapshot.close()
}
Response(Status.FORBIDDEN)
} else if (snapshot != null && imageDatum != null) {
request.handleCacheHit(sanitizedUri, getRc4(rc4Bytes), snapshot, imageDatum)