1
0
Fork 1
mirror of https://gitlab.com/mangadex-pub/mangadex_at_home.git synced 2024-01-19 02:48:37 +00:00

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)