If source.method is "post", use HTTP POST method (#21010)

Summary:
The React Native Web View takes a method option to determine if HTTP GET or HTTP POST should be used.
For iPhone this is not case sensitive, meaning that `method: "post"` is allowed.
For Android "post" is not understood and therefore the request will be using HTTP GET.

I suggest we ignore case for the method, or throw an Exception.
Pull Request resolved: https://github.com/facebook/react-native/pull/21010

Differential Revision: D9700895

Pulled By: hramos

fbshipit-source-id: 3fa904e7946dd40958cb44f9a234ee66cb68fab2
This commit is contained in:
Daniel Ignat 2018-09-07 07:49:55 -07:00 committed by Facebook Github Bot
parent 27348f0f07
commit 6e7ffff4a5
1 changed files with 1 additions and 1 deletions

View File

@ -525,7 +525,7 @@ public class ReactWebViewManager extends SimpleViewManager<WebView> {
}
if (source.hasKey("method")) {
String method = source.getString("method");
if (method.equals(HTTP_METHOD_POST)) {
if (method.equalsIgnoreCase(HTTP_METHOD_POST)) {
byte[] postData = null;
if (source.hasKey("body")) {
String body = source.getString("body");