batcave: remove cross origin referer (#8625)

This commit is contained in:
AwkwardPeak7 2025-04-26 18:32:00 +05:00 committed by Draff
parent 83631d067e
commit ee29f284f5
No known key found for this signature in database
GPG Key ID: E8A89F3211677653
2 changed files with 11 additions and 1 deletions

View File

@ -1,7 +1,7 @@
ext {
extName = 'BatCave'
extClass = '.BatCave'
extVersionCode = 3
extVersionCode = 4
}
apply from: "$rootDir/common.gradle"

View File

@ -222,6 +222,16 @@ class BatCave : HttpSource() {
}
}
override fun imageRequest(page: Page): Request {
val imageHeaders = headersBuilder().apply {
if (!page.imageUrl!!.toHttpUrl().host.contains("batcave")) {
removeAll("Referer")
}
}.build()
return GET(page.imageUrl!!, imageHeaders)
}
override fun imageUrlParse(response: Response): String {
throw UnsupportedOperationException()
}