pull/37/head
kunfei 5 years ago
parent e035fd06b8
commit 3de1fcdba3
  1. 2
      app/src/main/java/io/legado/app/data/entities/BookSource.kt
  2. 2
      app/src/main/java/io/legado/app/help/storage/OldRule.kt

@ -68,7 +68,7 @@ data class BookSource(
fun getHeaderMap(): Map<String, String> { fun getHeaderMap(): Map<String, String> {
val headerMap = HashMap<String, String>() val headerMap = HashMap<String, String>()
headerMap["user-agent"] = App.INSTANCE.getPrefString("user_agent") ?: userAgent headerMap["User-Agent"] = App.INSTANCE.getPrefString("user_agent") ?: userAgent
header?.let { header?.let {
GSON.fromJsonObject<Map<String, String>>(header)?.let { GSON.fromJsonObject<Map<String, String>>(header)?.let {
headerMap.putAll(it) headerMap.putAll(it)

@ -131,7 +131,7 @@ object OldRule {
private fun uaToHeader(ua: String?): String? { private fun uaToHeader(ua: String?): String? {
if (ua.isNullOrEmpty()) return null if (ua.isNullOrEmpty()) return null
val map = mapOf(Pair("user-agent", ua)) val map = mapOf(Pair("User-Agent", ua))
return GSON.toJson(map) return GSON.toJson(map)
} }

Loading…
Cancel
Save