From c8059eae039c53a3d06d476536a725cb9171161d Mon Sep 17 00:00:00 2001 From: Amos Ng Date: Mon, 6 Jul 2020 04:11:44 +0800 Subject: [PATCH] Deprecated `Referer` checking for hotlink prevention in favour of token verification system --- CHANGELOG.md | 1 + src/main/kotlin/mdnet/base/server/ImageServer.kt | 5 +---- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ae3f97a..492cfbb 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - [2020-07-04] Changed GitLab CI to build on every push irregardless of tagging by [@carbotaniuman]. ### Deprecated +- [2020-07-05] Deprecated `Referer` checking for hotlink prevention in favour of token verification system by [@lflare]. ### Removed diff --git a/src/main/kotlin/mdnet/base/server/ImageServer.kt b/src/main/kotlin/mdnet/base/server/ImageServer.kt index fd2b0ef..0e239ef 100644 --- a/src/main/kotlin/mdnet/base/server/ImageServer.kt +++ b/src/main/kotlin/mdnet/base/server/ImageServer.kt @@ -135,10 +135,7 @@ class ImageServer( } } - if (request.header("Referer")?.startsWith("https://mangadex.org") == false) { - snapshot?.close() - Response(Status.FORBIDDEN) - } else if (snapshot != null && imageDatum != null) { + if (snapshot != null && imageDatum != null) { request.handleCacheHit(sanitizedUri, getRc4(rc4Bytes), snapshot, imageDatum) } else { if (snapshot != null) {