WebView.loadDataWithBaseURL(): handle mimeType=null

This commit is contained in:
Julian Winkler
2024-10-03 22:40:22 +02:00
parent 98af3b8584
commit dc4b40bdf4

View File

@@ -45,5 +45,5 @@ JNIEXPORT void JNICALL Java_android_webkit_WebView_native_1loadDataWithBaseURL(J
jsize data_jlen = (*env)->GetStringLength(env, data_jstr);
char *data = malloc(data_len + 1); // + 1 for NUL
(*env)->GetStringUTFRegion(env, data_jstr, 0, data_jlen, data);
webkit_web_view_load_bytes(webview, g_bytes_new(data, data_len), _CSTRING(mime_type), _CSTRING(encoding), _CSTRING(base_url));
webkit_web_view_load_bytes(webview, g_bytes_new(data, data_len), mime_type ? _CSTRING(mime_type) : "text/html", _CSTRING(encoding), _CSTRING(base_url));
}