diff --git a/app/src/main/java/io/legado/app/data/entities/BookSource.kt b/app/src/main/java/io/legado/app/data/entities/BookSource.kt index a8a88e4cb..6a373bdef 100644 --- a/app/src/main/java/io/legado/app/data/entities/BookSource.kt +++ b/app/src/main/java/io/legado/app/data/entities/BookSource.kt @@ -68,7 +68,7 @@ data class BookSource( fun getHeaderMap(): Map { val headerMap = HashMap() - headerMap["user_agent"] = App.INSTANCE.getPrefString("user_agent") ?: userAgent + headerMap["User-Agent"] = App.INSTANCE.getPrefString("user_agent") ?: userAgent header?.let { GSON.fromJsonObject>(header)?.let { headerMap.putAll(it) diff --git a/app/src/main/java/io/legado/app/help/storage/OldRule.kt b/app/src/main/java/io/legado/app/help/storage/OldRule.kt index 9295aaa0d..7418ea6c6 100644 --- a/app/src/main/java/io/legado/app/help/storage/OldRule.kt +++ b/app/src/main/java/io/legado/app/help/storage/OldRule.kt @@ -131,7 +131,7 @@ object OldRule { private fun uaToHeader(ua: String?): String? { if (ua.isNullOrEmpty()) return null - val map = mapOf(Pair("user_agent", ua)) + val map = mapOf(Pair("User-Agent", ua)) return GSON.toJson(map) }