diff --git a/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeRule.kt b/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeRule.kt index 6bbd6f770..b8e503599 100644 --- a/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeRule.kt +++ b/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeRule.kt @@ -66,7 +66,7 @@ class AnalyzeRule(val ruleData: RuleDataInterface) : JsExtensions { fun setRedirectUrl(url: String): URL? { kotlin.runCatching { val pos = url.indexOf(',') - redirectUrl = URL( if(pos == -1)url else url.substring(pos+1).trim{ it < '!'} ) + redirectUrl = URL( if(pos == -1) url else url.substring(0,pos)) } return redirectUrl } 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 9848c2b44..e0ac417c9 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 @@ -56,7 +56,7 @@ class AnalyzeUrl( init { val pos = baseUrl.indexOf(',') - if(pos != -1)baseUrl = baseUrl.substring(0,pos).trim { it < '!' } + if(pos != -1)baseUrl = baseUrl.substring(0,pos) headerMapF?.let { headerMap.putAll(it) if (it.containsKey("proxy")) { @@ -160,7 +160,7 @@ class AnalyzeUrl( var pos = ruleUrl.indexOf(',') - urlHasQuery = if(pos == -1) ruleUrl else ruleUrl.substring(0,pos).trim{ it < '!'} + urlHasQuery = if(pos == -1) ruleUrl else ruleUrl.substring(0,pos) url = NetworkUtils.getAbsoluteURL(baseUrl,urlHasQuery )