From ab40b518bdf4a98f5b0a1ae18a24d6365e85f9e0 Mon Sep 17 00:00:00 2001 From: Celeter Date: Wed, 23 Sep 2020 11:05:29 +0800 Subject: [PATCH] =?UTF-8?q?proxy=E9=87=8D=E6=96=B0=E5=8A=A0=E5=85=A5header?= =?UTF-8?q?s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/legado/app/model/analyzeRule/AnalyzeUrl.kt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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 7323c145d..94d67ec92 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 @@ -67,6 +67,10 @@ class AnalyzeUrl( } headerMapF?.let { headerMap.putAll(it) + if (it.containsKey("proxy")) { + proxy = it["proxy"] + headerMap.remove("proxy") + } } //替换参数 analyzeJs(key, page, speakText, speakSpeed, book) @@ -187,7 +191,6 @@ class AnalyzeUrl( val option = GSON.fromJsonObject(urlArray[1]) option?.let { _ -> option.method?.let { if (it.equals("POST", true)) method = RequestMethod.POST } - option.proxy?.let { proxy = it } option.headers?.let { headers -> if (headers is Map<*, *>) { headers.forEach { entry -> @@ -417,8 +420,7 @@ class AnalyzeUrl( val charset: String?, val webView: Any?, val headers: Any?, - val body: Any?, - val proxy: String? + val body: Any? ) }