Fix Android 4.1-4.3 WebView source baseUrl bug

Summary:
Resolves https://github.com/facebook/react-native/issues/11753 and https://github.com/facebook/react-native/issues/9835.

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.

The same fix has already been discussed, successfully tested and incorporated in https://github.com/NativeScript/NativeScript/issues/1038.
Closes https://github.com/facebook/react-native/pull/13789

Differential Revision: D5971910

Pulled By: shergin

fbshipit-source-id: 07795bdf0f13ddb1e8eec779d1cad59244f3687e
This commit is contained in:
Karl Tarvas 2017-10-03 18:30:21 -07:00 committed by Facebook Github Bot
parent 26f6f6019b
commit 59d9f8ca5e
1 changed files with 1 additions and 1 deletions

View File

@ -89,7 +89,7 @@ public class ReactWebViewManager extends SimpleViewManager<WebView> {
protected static final String REACT_CLASS = "RCTWebView";
protected static final String HTML_ENCODING = "UTF-8";
protected static final String HTML_MIME_TYPE = "text/html; charset=utf-8";
protected static final String HTML_MIME_TYPE = "text/html";
protected static final String BRIDGE_NAME = "__REACT_WEB_VIEW_BRIDGE";
protected static final String HTTP_METHOD_POST = "POST";