Skip to content

Commit

Permalink
If source.method is "post", use HTTP POST method (facebook#21010)
Browse files Browse the repository at this point in the history
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: facebook#21010

Differential Revision: D9700895

Pulled By: hramos

fbshipit-source-id: 3fa904e7946dd40958cb44f9a234ee66cb68fab2
  • Loading branch information
dignite authored and gengjiawen committed Sep 14, 2018
1 parent efb4dcc commit c692ca1
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ public void setSource(WebView view, @Nullable ReadableMap source) {
}
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");
Expand Down

0 comments on commit c692ca1

Please sign in to comment.