From f835c1666cb3465c9f64005bf0095f47f3b40b0a Mon Sep 17 00:00:00 2001 From: Etheryte Date: Fri, 5 May 2017 03:02:26 +0300 Subject: [PATCH] Fix Android 4.1-4.3 WebView source baseUrl bug Resolves https://github.com/facebook/react-native/issues/11753. Android versions 4.1-4.3 don't understand the MIME type 'text/html; charset=utf-8' and default to 'text/plain' instead, rendering the content as an unparsed HTML string. Since the encoding is already set and passed separately, removing it from the MIME type has no negative effects. --- .../com/facebook/react/views/webview/ReactWebViewManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/webview/ReactWebViewManager.java b/ReactAndroid/src/main/java/com/facebook/react/views/webview/ReactWebViewManager.java index 7e246a7ff68f47..747f61fad5a3e4 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/webview/ReactWebViewManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/webview/ReactWebViewManager.java @@ -87,7 +87,7 @@ public class ReactWebViewManager extends SimpleViewManager { protected static final String REACT_CLASS = "RCTWebView"; private static final String HTML_ENCODING = "UTF-8"; - private static final String HTML_MIME_TYPE = "text/html; charset=utf-8"; + private static final String HTML_MIME_TYPE = "text/html"; private static final String BRIDGE_NAME = "__REACT_WEB_VIEW_BRIDGE"; private static final String HTTP_METHOD_POST = "POST";