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'
pkgNameSuffix = 'all.mangadex'
extClass = '.MangaDexFactory'
extVersionCode = 115
extVersionCode = 116
libVersion = '1.2'
containsNsfw = true
}

View File

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