From a3a52bfc5253c5d7ec376cb206900e2d40252efc Mon Sep 17 00:00:00 2001 From: kunfei Date: Thu, 12 May 2022 15:46:07 +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/help/http/CookieStore.kt | 4 ++-- .../main/java/io/legado/app/model/analyzeRule/AnalyzeUrl.kt | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) 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 ace5ac5ca..b19c1feca 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 @@ -5,8 +5,8 @@ package io.legado.app.help.http import android.text.TextUtils import io.legado.app.data.appDb import io.legado.app.data.entities.Cookie -import io.legado.app.help.http.api.CookieManager import io.legado.app.help.CacheManager +import io.legado.app.help.http.api.CookieManager import io.legado.app.utils.NetworkUtils object CookieStore : CookieManager { @@ -44,7 +44,7 @@ object CookieStore : CookieManager { CacheManager.getFromMemory("${domain}_cookie")?.let { return it } val cookieBean = appDb.cookieDao.get(domain) val cookie = cookieBean?.cookie ?: "" - CacheManager.putMemory(url, cookie ?: "") + CacheManager.putMemory(url, cookie) return cookie } diff --git a/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeUrl.kt b/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeUrl.kt index 2802921d5..9d7b17338 100644 --- a/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeUrl.kt +++ b/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeUrl.kt @@ -528,8 +528,7 @@ class AnalyzeUrl( val cookieMap = CookieStore.cookieToMap(cookie) val customCookieMap = CookieStore.cookieToMap(headerMap["Cookie"] ?: "") cookieMap.putAll(customCookieMap) - val newCookie = CookieStore.mapToCookie(cookieMap) - newCookie?.let { + CookieStore.mapToCookie(cookieMap)?.let { headerMap.put("Cookie", it) } }