From 9df517ccefe5df17f8250d67f3996f578a6330ef Mon Sep 17 00:00:00 2001 From: gedoor Date: Sat, 14 Nov 2020 16:58:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/io/legado/app/utils/NetworkUtils.kt | 1 + app/src/main/java/io/legado/app/utils/StringExtensions.kt | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) 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 =