From c40cf38cf5f084d90a4bca4a06bf0337c1978b0b Mon Sep 17 00:00:00 2001 From: mkusnierz Date: Tue, 19 May 2026 16:08:54 +0200 Subject: [PATCH] fix: Update MIME type handling in CustomWebChromeClient --- .../wlednativeandroid/ui/components/DeviceWebview.kt | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/ca/cgagnier/wlednativeandroid/ui/components/DeviceWebview.kt b/app/src/main/java/ca/cgagnier/wlednativeandroid/ui/components/DeviceWebview.kt index 3c8dba9e..25c0b891 100644 --- a/app/src/main/java/ca/cgagnier/wlednativeandroid/ui/components/DeviceWebview.kt +++ b/app/src/main/java/ca/cgagnier/wlednativeandroid/ui/components/DeviceWebview.kt @@ -389,13 +389,14 @@ class CustomWebChromeClient(private val context: Context) : WebChromeClient() { private fun getMimeType(acceptTypes: Array): String { for (type in acceptTypes) { - return when (type) { - ".json" -> "application/json" - ".css" -> "text/css" + return when { + type == ".json" -> "application/json" + type == ".css" -> "text/css" + type.contains("/") -> type else -> continue } } - return "application/octet-stream" + return "*/*" } }