diff --git a/app/src/main/java/io/legado/app/help/http/HttpHelper.kt b/app/src/main/java/io/legado/app/help/http/HttpHelper.kt index 1e8fb27e1..c4ae52ba2 100644 --- a/app/src/main/java/io/legado/app/help/http/HttpHelper.kt +++ b/app/src/main/java/io/legado/app/help/http/HttpHelper.kt @@ -27,12 +27,10 @@ val cookieJar by lazy { if (cookies.isEmpty()) return //临时保存 书源启用cookie选项再添加到数据库 val cookieBuilder = StringBuilder() - cookies.forEach { - if (it.value != "") { - cookieBuilder.append(it.name).append("=").append(it.value).append(";") - } + cookies.forEachIndexed { index, cookie -> + if (index > 0) cookieBuilder.append("; ") + cookieBuilder.append(cookie.name).append('=').append(cookie.value) } - cookieBuilder.deleteCharAt(cookieBuilder.lastIndexOf(";")) val domain = NetworkUtils.getSubDomain(url.toString()) CacheManager.putMemory("${domain}_cookieJar", cookieBuilder.toString()) }