diff --git a/pluto-plugins/plugins/network/interceptor-ktor/lib/src/main/kotlin/com/pluto/plugins/network/ktor/internal/KtorResponseConverter.kt b/pluto-plugins/plugins/network/interceptor-ktor/lib/src/main/kotlin/com/pluto/plugins/network/ktor/internal/KtorResponseConverter.kt index 8b6555d1..888e1b05 100644 --- a/pluto-plugins/plugins/network/interceptor-ktor/lib/src/main/kotlin/com/pluto/plugins/network/ktor/internal/KtorResponseConverter.kt +++ b/pluto-plugins/plugins/network/interceptor-ktor/lib/src/main/kotlin/com/pluto/plugins/network/ktor/internal/KtorResponseConverter.kt @@ -4,6 +4,7 @@ import com.pluto.plugins.network.intercept.NetworkData.Body import com.pluto.plugins.network.intercept.NetworkData.Response import io.ktor.client.statement.HttpResponse import io.ktor.client.statement.bodyAsText +import io.ktor.http.ContentType import io.ktor.http.Headers import io.ktor.http.contentType @@ -34,7 +35,7 @@ internal object KtorResponseConverter : ResponseConverter { // TODO handle gzip private suspend fun HttpResponse.extractBody() = Body( body = bodyAsText(), - contentType = contentType().toString() + contentType = contentType()?.toString() ?: ContentType.Any.toString() ) // private fun HttpResponse.isTextType(): Boolean {