From d08e3b52f31510c3455ed925bac846a726fc4523 Mon Sep 17 00:00:00 2001 From: gedoor Date: Thu, 27 Aug 2020 15:21:42 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/io/legado/app/model/analyzeRule/AnalyzeUrl.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 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 65d513831..4ac7227d8 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 @@ -59,10 +59,11 @@ class AnalyzeUrl( private var body: String? = null private var requestBody: RequestBody? = null private var method = RequestMethod.GET + private val splitUrlRegex = Regex(",[^\\{]*") init { baseUrl?.let { - this.baseUrl = it.split(",[^\\{]*".toRegex(), 1)[0] + this.baseUrl = it.split(splitUrlRegex, 1)[0] } headerMapF?.let { headerMap.putAll(it) } //替换参数 @@ -172,7 +173,7 @@ class AnalyzeUrl( * 处理URL */ private fun initUrl() { - var urlArray = ruleUrl.split(",[^\\{]*".toRegex(), 2) + var urlArray = ruleUrl.split(splitUrlRegex, 2) url = urlArray[0] urlHasQuery = urlArray[0] NetworkUtils.getBaseUrl(url)?.let {