pull/341/head^2
gedoor 4 years ago
parent 0139621aba
commit 64c7303c15
  1. 7
      app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeUrl.kt

@ -50,7 +50,7 @@ class AnalyzeUrl(
private var baseUrl: String = "" private var baseUrl: String = ""
lateinit var url: String lateinit var url: String
private set private set
var path: String? = null lateinit var urlHasQuery: String
private set private set
val headerMap = HashMap<String, String>() val headerMap = HashMap<String, String>()
private var queryStr: String? = null private var queryStr: String? = null
@ -174,6 +174,7 @@ class AnalyzeUrl(
private fun initUrl() { private fun initUrl() {
var urlArray = ruleUrl.split(",[^\\{]*".toRegex(), 2) var urlArray = ruleUrl.split(",[^\\{]*".toRegex(), 2)
url = urlArray[0] url = urlArray[0]
urlHasQuery = urlArray[0]
NetworkUtils.getBaseUrl(url)?.let { NetworkUtils.getBaseUrl(url)?.let {
baseUrl = it baseUrl = it
} }
@ -392,13 +393,13 @@ class AnalyzeUrl(
@Throws(Exception::class) @Throws(Exception::class)
fun getGlideUrl(): Any? { fun getGlideUrl(): Any? {
var glideUrl: Any = url var glideUrl: Any = urlHasQuery
if(headerMap.isNotEmpty()) { if(headerMap.isNotEmpty()) {
val headers = LazyHeaders.Builder() val headers = LazyHeaders.Builder()
headerMap.forEach {(key, value) -> headerMap.forEach {(key, value) ->
headers.addHeader(key, value) headers.addHeader(key, value)
} }
glideUrl = GlideUrl(url, headers.build()) glideUrl = GlideUrl(urlHasQuery, headers.build())
} }
return glideUrl return glideUrl
} }

Loading…
Cancel
Save