Tachidesk: bypass DoH (#14184)

* Tachidesk: Bypass DoH

* bump version

* fix imports
This commit is contained in:
Aria Moradi 2022-11-08 15:56:10 +03:30 committed by GitHub
parent d04de13a34
commit 90915c6883
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View File

@ -6,7 +6,7 @@ ext {
extName = 'Tachidesk'
pkgNameSuffix = 'all.tachidesk'
extClass = '.Tachidesk'
extVersionCode = 6
extVersionCode = 7
}
dependencies {

View File

@ -21,7 +21,9 @@ import eu.kanade.tachiyomi.source.online.HttpSource
import kotlinx.serialization.decodeFromString
import kotlinx.serialization.json.Json
import okhttp3.Credentials
import okhttp3.Dns
import okhttp3.Headers
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.Response
import rx.Observable
@ -43,6 +45,11 @@ class Tachidesk : ConfigurableSource, UnmeteredSource, HttpSource() {
private val json: Json by injectLazy()
override val client: OkHttpClient =
network.client.newBuilder()
.dns(Dns.SYSTEM) // don't use DNS over HTTPS as it breaks IP addressing
.build()
override fun headersBuilder(): Headers.Builder = Headers.Builder().apply {
if (basePassword.isNotEmpty() && baseLogin.isNotEmpty()) {
val credentials = Credentials.basic(baseLogin, basePassword)