feat: 优化

pull/219/head
kunfei 5 years ago
parent 5282914d65
commit 1398696a26
  1. 2
      app/src/main/java/io/legado/app/constant/AppConst.kt
  2. 2
      app/src/main/java/io/legado/app/help/http/HttpHelper.kt

@ -20,7 +20,7 @@ object AppConst {
const val UA_NAME = "User-Agent"
val userAgent: String by lazy {
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36"
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36"
}
val SCRIPT_ENGINE: ScriptEngine by lazy {

@ -1,5 +1,6 @@
package io.legado.app.help.http
import io.legado.app.constant.AppConst
import io.legado.app.help.http.api.HttpGetApi
import io.legado.app.utils.NetworkUtils
import kotlinx.coroutines.suspendCancellableCoroutine
@ -94,6 +95,7 @@ object HttpHelper {
return Interceptor { chain ->
val request = chain.request()
.newBuilder()
.addHeader(AppConst.UA_NAME, AppConst.userAgent)
.addHeader("Keep-Alive", "300")
.addHeader("Connection", "Keep-Alive")
.addHeader("Cache-Control", "no-cache")

Loading…
Cancel
Save