diff --git a/app/src/main/java/io/legado/app/help/http/CookieStore.kt b/app/src/main/java/io/legado/app/help/http/CookieStore.kt index ca0ab8109..dd537303d 100644 --- a/app/src/main/java/io/legado/app/help/http/CookieStore.kt +++ b/app/src/main/java/io/legado/app/help/http/CookieStore.kt @@ -86,16 +86,11 @@ object CookieStore : CookieManager { return null } val builder = StringBuilder() - for (key in cookieMap.keys) { - val value = cookieMap[key] - if (value?.isNotBlank() == true) { - builder.append(key) - .append("=") - .append(value) - .append(";") - } + cookieMap.keys.forEachIndexed { index, key -> + if (index > 0) builder.append("; ") + builder.append(key).append("=").append(cookieMap[key]) } - return builder.deleteCharAt(builder.lastIndexOf(";")).toString() + return builder.toString() } fun clear() {