Merge pull request #436 from AndyBernie/master

修复:java.ajax(url)在某些情况下未设置默认ua
pull/438/head
kunfei 4 years ago committed by GitHub
commit 00e210e8de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeUrl.kt

@ -188,10 +188,10 @@ class AnalyzeUrl(
GSON.fromJsonObject<Map<String, String>>(headers) GSON.fromJsonObject<Map<String, String>>(headers)
?.let { headerMap.putAll(it) } ?.let { headerMap.putAll(it) }
} }
}
headerMap[UA_NAME] ?: let { headerMap[UA_NAME] ?: let {
headerMap[UA_NAME] = userAgent headerMap[UA_NAME] = userAgent
} }
}
option.charset?.let { charset = it } option.charset?.let { charset = it }
option.body?.let { option.body?.let {
body = if (it is String) it else GSON.toJson(it) body = if (it is String) it else GSON.toJson(it)

Loading…
Cancel
Save