mirror of
https://gitlab.com/ultrasonic/ultrasonic.git
synced 2025-06-07 02:53:05 +03:00
Disabled Http2 in OkHttp
This commit is contained in:
parent
f6ed5a4ff8
commit
d7e938ac36
@ -10,6 +10,7 @@ import javax.net.ssl.SSLContext
|
|||||||
import javax.net.ssl.X509TrustManager
|
import javax.net.ssl.X509TrustManager
|
||||||
import okhttp3.Credentials
|
import okhttp3.Credentials
|
||||||
import okhttp3.OkHttpClient
|
import okhttp3.OkHttpClient
|
||||||
|
import okhttp3.Protocol
|
||||||
import okhttp3.ResponseBody
|
import okhttp3.ResponseBody
|
||||||
import okhttp3.logging.HttpLoggingInterceptor
|
import okhttp3.logging.HttpLoggingInterceptor
|
||||||
import org.moire.ultrasonic.api.subsonic.interceptors.PasswordHexInterceptor
|
import org.moire.ultrasonic.api.subsonic.interceptors.PasswordHexInterceptor
|
||||||
@ -64,6 +65,9 @@ class SubsonicAPIClient(
|
|||||||
}
|
}
|
||||||
|
|
||||||
val okHttpClient: OkHttpClient = baseOkClient.newBuilder()
|
val okHttpClient: OkHttpClient = baseOkClient.newBuilder()
|
||||||
|
// Disable HTTP2 because OkHttp with Exoplayer causes a bug. See https://github.com/square/okhttp/issues/6749
|
||||||
|
// TODO Check if the bug is fixed and try to re-enable HTTP2
|
||||||
|
.protocols(listOf(Protocol.HTTP_1_1))
|
||||||
.readTimeout(READ_TIMEOUT, MILLISECONDS)
|
.readTimeout(READ_TIMEOUT, MILLISECONDS)
|
||||||
.apply { if (config.allowSelfSignedCertificate) allowSelfSignedCertificates() }
|
.apply { if (config.allowSelfSignedCertificate) allowSelfSignedCertificates() }
|
||||||
.addInterceptor { chain ->
|
.addInterceptor { chain ->
|
||||||
|
Loading…
x
Reference in New Issue
Block a user