Add Referer header to MangaDex. (#7393)

This commit is contained in:
Alessandro Jean 2021-06-02 17:28:31 -03:00 committed by GitHub
parent 10eb030895
commit d191a78d97
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 9 deletions

View File

@ -5,7 +5,7 @@ ext {
extName = 'MangaDex' extName = 'MangaDex'
pkgNameSuffix = 'all.mangadex' pkgNameSuffix = 'all.mangadex'
extClass = '.MangaDexFactory' extClass = '.MangaDexFactory'
extVersionCode = 115 extVersionCode = 116
libVersion = '1.2' libVersion = '1.2'
containsNsfw = true containsNsfw = true
} }

View File

@ -46,15 +46,15 @@ abstract class MangaDex(override val lang: String, val dexLang: String) :
private val helper = MangaDexHelper() private val helper = MangaDexHelper()
override fun headersBuilder() = Headers.Builder().apply { override fun headersBuilder() = Headers.Builder()
add("User-Agent", "Tachiyomi " + System.getProperty("http.agent")) .add("Referer", "$baseUrl/")
} .add("User-Agent", "Tachiyomi " + System.getProperty("http.agent"))
override val client = override val client = network.client.newBuilder()
network.client.newBuilder().addNetworkInterceptor(mdRateLimitInterceptor).addInterceptor( .addNetworkInterceptor(mdRateLimitInterceptor)
coverInterceptor .addInterceptor(coverInterceptor)
).addInterceptor(MdAtHomeReportInterceptor(network.client, headersBuilder().build())) .addInterceptor(MdAtHomeReportInterceptor(network.client, headersBuilder().build()))
.build() .build()
// POPULAR Manga Section // POPULAR Manga Section