Skip to content

Commit

Permalink
fix(Windows): Refactor ReactWebView2.cpp to handle optional 'method' …
Browse files Browse the repository at this point in the history
…parameter (react-native-webview#3319)

Co-authored-by: Kennedy Mumo <kemumo@microsoft.com>
  • Loading branch information
jfkm69 and Kennedy Mumo committed Feb 6, 2024
1 parent 07cebe3 commit f0791d8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion windows/ReactNativeWebView/ReactWebView2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -404,8 +404,9 @@ namespace winrt::ReactNativeWebView::implementation {
if (m_webView.CoreWebView2())
{
auto uri = winrt::Uri(winrt::to_hstring(m_request.at("uri").AsString()));
auto method = (m_request.find("method") != m_request.end()) ? m_request.at("method").AsString() : "GET";
auto webResourceRequest = m_webView.CoreWebView2().Environment().CreateWebResourceRequest(
uri.ToString(), winrt::to_hstring(m_request.at("method").AsString()), nullptr, L"");
uri.ToString(), winrt::to_hstring(method), nullptr, L"");

SetupRequest(m_request.Copy(), webResourceRequest);

Expand Down

0 comments on commit f0791d8

Please sign in to comment.