pull/46/head
kunfei 5 years ago
parent aa4f7512d0
commit 8190b7f711
  1. 4
      app/src/main/java/io/legado/app/help/http/CookieStore.kt

@ -20,14 +20,12 @@ object CookieStore {
return return
} }
val oldCookie = getCookie(url) val oldCookie = getCookie(url)
if (TextUtils.isEmpty(oldCookie)) { if (TextUtils.isEmpty(oldCookie)) {
setCookie(url, cookie) setCookie(url, cookie)
} else { } else {
val cookieMap = cookieToMap(oldCookie) val cookieMap = cookieToMap(oldCookie)
cookieMap.putAll(cookieToMap(cookie)) cookieMap.putAll(cookieToMap(cookie))
val newCookie = mapToCookie(cookieMap) val newCookie = mapToCookie(cookieMap)
setCookie(url, newCookie) setCookie(url, newCookie)
} }
} }
@ -59,7 +57,7 @@ object CookieStore {
val key = pairs[0].trim { it <= ' ' } val key = pairs[0].trim { it <= ' ' }
val value = pairs[1] val value = pairs[1]
if (value.isNotBlank() || value.trim { it <= ' ' } == "null") { if (value.isNotBlank() || value.trim { it <= ' ' } == "null") {
cookieMap.put(key, value.trim { it <= ' ' }) cookieMap[key] = value.trim { it <= ' ' }
} }
} }
return cookieMap return cookieMap

Loading…
Cancel
Save