From f59131aa0551f9fe2b2db1bff5f76a09b80324bb Mon Sep 17 00:00:00 2001 From: gedoor Date: Mon, 14 Dec 2020 16:41:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/legado/app/help/http/StrResponse.kt | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/io/legado/app/help/http/StrResponse.kt b/app/src/main/java/io/legado/app/help/http/StrResponse.kt index 3533bbd17..19255c47e 100644 --- a/app/src/main/java/io/legado/app/help/http/StrResponse.kt +++ b/app/src/main/java/io/legado/app/help/http/StrResponse.kt @@ -15,13 +15,12 @@ class StrResponse private constructor( ) { fun raw() = rawResponse - val url: String - get() { - rawResponse.networkResponse?.let { - return it.request.url.toString() - } - return rawResponse.request.url.toString() + fun url(): String { + rawResponse.networkResponse?.let { + return it.request.url.toString() } + return rawResponse.request.url.toString() + } fun code(): Int { return rawResponse.code @@ -35,8 +34,7 @@ class StrResponse private constructor( return rawResponse.headers } - val isSuccessful: Boolean - get() = rawResponse.isSuccessful + fun isSuccessful(): Boolean = rawResponse.isSuccessful fun errorBody(): ResponseBody? { return errorBody