pull/478/head
gedoor 4 years ago
parent 1003500fcd
commit 9df517ccef
  1. 1
      app/src/main/java/io/legado/app/utils/NetworkUtils.kt
  2. 3
      app/src/main/java/io/legado/app/utils/StringExtensions.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(","))

@ -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 =

Loading…
Cancel
Save