From cd4969c97df6b9a948bcc6a8b71a74ffbff2b445 Mon Sep 17 00:00:00 2001 From: AndyBernie Date: Wed, 26 Aug 2020 18:52:40 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=BAjava.ajax(url)=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E9=BB=98=E8=AE=A4ua?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeUrl.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeUrl.kt b/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeUrl.kt index 561e3a320..3c75a20b3 100644 --- a/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeUrl.kt +++ b/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeUrl.kt @@ -191,6 +191,7 @@ class AnalyzeUrl( ?.let { headerMap.putAll(it) } } } + headerMap[UA_NAME] = headerMap[UA_NAME] ?: userAgent charset = option.charset body = if (option.body is String) { option.body @@ -352,7 +353,6 @@ class AnalyzeUrl( if (cookie.isNotEmpty()) { headerMap["Cookie"] += cookie } - headerMap[UA_NAME] = headerMap[UA_NAME] ?: userAgent return if (fieldMap.isEmpty()) { HttpHelper.getBytes(url, mapOf(), headerMap) } else {