Skip to content

Commit 6e7ffff

Browse files
dignitefacebook-github-bot
authored andcommitted
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: #21010 Differential Revision: D9700895 Pulled By: hramos fbshipit-source-id: 3fa904e7946dd40958cb44f9a234ee66cb68fab2
1 parent 27348f0 commit 6e7ffff

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ReactAndroid/src/main/java/com/facebook/react/views/webview/ReactWebViewManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,7 @@ public void setSource(WebView view, @Nullable ReadableMap source) {
525525
}
526526
if (source.hasKey("method")) {
527527
String method = source.getString("method");
528-
if (method.equals(HTTP_METHOD_POST)) {
528+
if (method.equalsIgnoreCase(HTTP_METHOD_POST)) {
529529
byte[] postData = null;
530530
if (source.hasKey("body")) {
531531
String body = source.getString("body");

0 commit comments

Comments
 (0)