Check for mangadex.org prefix rather than checking if referer contains

string
This commit is contained in:
Amos Ng 2020-06-29 06:16:28 +08:00
parent 00e4ac20bb
commit d24c061cc6
No known key found for this signature in database
GPG key ID: 89086414F634D123

View file

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