From 326a3f78b27ef215f7a3236981f2d55cd2285a66 Mon Sep 17 00:00:00 2001 From: Koitharu Date: Thu, 19 Dec 2024 14:57:44 +0200 Subject: [PATCH] Fix Response.mimeType extension --- src/main/kotlin/org/koitharu/kotatsu/parsers/util/OkHttp.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/util/OkHttp.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/util/OkHttp.kt index 4d692a8e..259158f7 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/util/OkHttp.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/util/OkHttp.kt @@ -17,8 +17,9 @@ public suspend fun Call.await(): Response = suspendCancellableCoroutine { contin } public val Response.mimeType: String? - get() = header("content-type")?.nullIfEmpty() + get() = header("content-type")?.substringBefore(';')?.trim()?.nullIfEmpty()?.lowercase() +@Deprecated("") public val Response.contentDisposition: String? get() = header("Content-Disposition")