diff --git a/app/src/main/java/io/legado/app/utils/NetworkUtils.kt b/app/src/main/java/io/legado/app/utils/NetworkUtils.kt index 171cd9b50..d08e4a450 100644 --- a/app/src/main/java/io/legado/app/utils/NetworkUtils.kt +++ b/app/src/main/java/io/legado/app/utils/NetworkUtils.kt @@ -80,6 +80,7 @@ object NetworkUtils { fun getAbsoluteURL(baseURL: String?, relativePath: String?): String? { if (baseURL.isNullOrEmpty()) return relativePath if (relativePath.isNullOrEmpty()) return baseURL + if (relativePath.isAbsUrl()) return baseURL var relativeUrl = relativePath try { val absoluteUrl = URL(baseURL.substringBefore(",")) diff --git a/app/src/main/java/io/legado/app/utils/StringExtensions.kt b/app/src/main/java/io/legado/app/utils/StringExtensions.kt index f00c332d5..f70ab447e 100644 --- a/app/src/main/java/io/legado/app/utils/StringExtensions.kt +++ b/app/src/main/java/io/legado/app/utils/StringExtensions.kt @@ -23,8 +23,7 @@ fun String.parseToUri(): Uri { fun String?.isAbsUrl() = this?.let { - it.startsWith("http://", true) - || it.startsWith("https://", true) + it.startsWith("http://", true) || it.startsWith("https://", true) } ?: false fun String?.isJson(): Boolean =