react-native-windows 0.72.30 → 0.72.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -10,11 +10,11 @@
|
|
|
10
10
|
-->
|
|
11
11
|
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
12
12
|
<PropertyGroup>
|
|
13
|
-
<ReactNativeWindowsVersion>0.72.
|
|
13
|
+
<ReactNativeWindowsVersion>0.72.31</ReactNativeWindowsVersion>
|
|
14
14
|
<ReactNativeWindowsMajor>0</ReactNativeWindowsMajor>
|
|
15
15
|
<ReactNativeWindowsMinor>72</ReactNativeWindowsMinor>
|
|
16
|
-
<ReactNativeWindowsPatch>
|
|
16
|
+
<ReactNativeWindowsPatch>31</ReactNativeWindowsPatch>
|
|
17
17
|
<ReactNativeWindowsCanary>false</ReactNativeWindowsCanary>
|
|
18
|
-
<ReactNativeWindowsCommitId>
|
|
18
|
+
<ReactNativeWindowsCommitId>b97a232cabbeefb2eb45d423104236188c50fdd4</ReactNativeWindowsCommitId>
|
|
19
19
|
</PropertyGroup>
|
|
20
20
|
</Project>
|
|
@@ -154,8 +154,16 @@ bool OriginPolicyHttpFilter::ConstWcharComparer::operator()(const wchar_t *a, co
|
|
|
154
154
|
return s_simpleCorsMethods.find(request.Method().ToString().c_str()) != s_simpleCorsMethods.cend();
|
|
155
155
|
}
|
|
156
156
|
|
|
157
|
-
/*static*/
|
|
158
|
-
|
|
157
|
+
/*static*/ const hstring OriginPolicyHttpFilter::GetOrigin(Uri const &uri) noexcept {
|
|
158
|
+
auto const &scheme = uri.SchemeName();
|
|
159
|
+
auto port = uri.Port();
|
|
160
|
+
|
|
161
|
+
hstring result = scheme + L"://" + uri.Host();
|
|
162
|
+
if (!(port == 80 && scheme == L"http") && !(port == 443 && scheme == L"https")) {
|
|
163
|
+
result = result + L":" + to_hstring(port);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
return result;
|
|
159
167
|
}
|
|
160
168
|
|
|
161
169
|
/*static*/ bool OriginPolicyHttpFilter::AreSafeRequestHeaders(
|
|
@@ -677,7 +685,7 @@ ResponseOperation OriginPolicyHttpFilter::SendPreflightAsync(HttpRequestMessage
|
|
|
677
685
|
}
|
|
678
686
|
|
|
679
687
|
preflightRequest.Headers().Insert(L"Access-Control-Request-Headers", headerNames);
|
|
680
|
-
preflightRequest.Headers().Insert(L"Origin", s_origin
|
|
688
|
+
preflightRequest.Headers().Insert(L"Origin", GetOrigin(s_origin));
|
|
681
689
|
preflightRequest.Headers().Insert(L"Sec-Fetch-Mode", L"CORS");
|
|
682
690
|
|
|
683
691
|
co_return {co_await m_innerFilter.SendRequestAsync(preflightRequest)};
|
|
@@ -763,7 +771,7 @@ ResponseOperation OriginPolicyHttpFilter::SendRequestAsync(HttpRequestMessage co
|
|
|
763
771
|
|
|
764
772
|
if (originPolicy == OriginPolicy::SimpleCrossOriginResourceSharing ||
|
|
765
773
|
originPolicy == OriginPolicy::CrossOriginResourceSharing) {
|
|
766
|
-
coRequest.Headers().Insert(L"Origin", s_origin
|
|
774
|
+
coRequest.Headers().Insert(L"Origin", GetOrigin(s_origin));
|
|
767
775
|
}
|
|
768
776
|
|
|
769
777
|
auto response = co_await m_innerFilter.SendRequestAsync(coRequest);
|
|
@@ -57,7 +57,7 @@ class OriginPolicyHttpFilter
|
|
|
57
57
|
winrt::Windows::Foundation::Uri const &u1,
|
|
58
58
|
winrt::Windows::Foundation::Uri const &u2) noexcept;
|
|
59
59
|
|
|
60
|
-
static winrt::
|
|
60
|
+
static const winrt::hstring GetOrigin(winrt::Windows::Foundation::Uri const &uri) noexcept;
|
|
61
61
|
|
|
62
62
|
static bool IsSimpleCorsRequest(winrt::Windows::Web::Http::HttpRequestMessage const &request) noexcept;
|
|
63
63
|
|