react-native-windows 0.73.9 → 0.73.11
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.
- package/Libraries/Components/Pressable/Pressable.windows.js +1 -0
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/Libraries/LogBox/Data/parseLogBoxLog.js +1 -1
- package/Libraries/Pressability/Pressability.windows.js +3 -2
- package/PropertySheets/Generated/PackageVersion.g.props +3 -3
- package/Shared/Networking/OriginPolicyHttpFilter.cpp +29 -25
- package/Shared/Networking/OriginPolicyHttpFilter.h +5 -8
- package/Shared/Networking/WinRTHttpResource.cpp +2 -4
- package/package.json +6 -6
|
@@ -325,6 +325,7 @@ function Pressable(props: Props, forwardedRef): React.Node {
|
|
|
325
325
|
accessibilityLiveRegion,
|
|
326
326
|
accessibilityLabel,
|
|
327
327
|
accessibilityState: _accessibilityState,
|
|
328
|
+
disabled: disabled == true,
|
|
328
329
|
focusable: focusable !== false,
|
|
329
330
|
accessibilityValue,
|
|
330
331
|
hitSlop,
|
|
@@ -192,7 +192,7 @@ export function parseComponentStack(message: string): ComponentStack {
|
|
|
192
192
|
if (!s) {
|
|
193
193
|
return null;
|
|
194
194
|
}
|
|
195
|
-
const match = s.match(/(.*) \(at (.*\.js):([\d]+)\)/);
|
|
195
|
+
const match = s.match(/(.*) \(at (.*\.(?:js|jsx|ts|tsx)):([\d]+)\)/);
|
|
196
196
|
if (!match) {
|
|
197
197
|
return null;
|
|
198
198
|
}
|
|
@@ -642,14 +642,15 @@ export default class Pressability {
|
|
|
642
642
|
this._isKeyDown = false;
|
|
643
643
|
},
|
|
644
644
|
onKeyDown: (event: KeyEvent): void => {
|
|
645
|
-
const {onKeyDown} = this._config;
|
|
645
|
+
const {onKeyDown, disabled} = this._config;
|
|
646
646
|
onKeyDown && onKeyDown(event);
|
|
647
647
|
|
|
648
648
|
if (
|
|
649
649
|
(event.nativeEvent.code === 'Space' ||
|
|
650
650
|
event.nativeEvent.code === 'Enter' ||
|
|
651
651
|
event.nativeEvent.code === 'GamepadA') &&
|
|
652
|
-
event.defaultPrevented
|
|
652
|
+
event.defaultPrevented !== true &&
|
|
653
|
+
disabled !== true
|
|
653
654
|
) {
|
|
654
655
|
const {onPressIn} = this._config;
|
|
655
656
|
this._isKeyDown = true;
|
|
@@ -10,11 +10,11 @@
|
|
|
10
10
|
-->
|
|
11
11
|
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
12
12
|
<PropertyGroup>
|
|
13
|
-
<ReactNativeWindowsVersion>0.73.
|
|
13
|
+
<ReactNativeWindowsVersion>0.73.11</ReactNativeWindowsVersion>
|
|
14
14
|
<ReactNativeWindowsMajor>0</ReactNativeWindowsMajor>
|
|
15
15
|
<ReactNativeWindowsMinor>73</ReactNativeWindowsMinor>
|
|
16
|
-
<ReactNativeWindowsPatch>
|
|
16
|
+
<ReactNativeWindowsPatch>11</ReactNativeWindowsPatch>
|
|
17
17
|
<ReactNativeWindowsCanary>false</ReactNativeWindowsCanary>
|
|
18
|
-
<ReactNativeWindowsCommitId>
|
|
18
|
+
<ReactNativeWindowsCommitId>1a56053a4c4912271841269db84956d6b525f795</ReactNativeWindowsCommitId>
|
|
19
19
|
</PropertyGroup>
|
|
20
20
|
</Project>
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
#include <regex>
|
|
19
19
|
|
|
20
20
|
using std::set;
|
|
21
|
+
using std::string;
|
|
21
22
|
using std::wstring;
|
|
22
23
|
|
|
23
24
|
using winrt::hresult_error;
|
|
@@ -114,15 +115,6 @@ bool OriginPolicyHttpFilter::CaseInsensitiveComparer::operator()(const wstring &
|
|
|
114
115
|
/*static*/ set<const wchar_t *, OriginPolicyHttpFilter::CaseInsensitiveComparer>
|
|
115
116
|
OriginPolicyHttpFilter::s_corsForbiddenRequestHeaderNamePrefixes = {L"Proxy-", L"Sec-"};
|
|
116
117
|
|
|
117
|
-
/*static*/ Uri OriginPolicyHttpFilter::s_origin{nullptr};
|
|
118
|
-
|
|
119
|
-
/*static*/ void OriginPolicyHttpFilter::SetStaticOrigin(std::string &&url) {
|
|
120
|
-
if (!url.empty())
|
|
121
|
-
s_origin = Uri{to_hstring(url)};
|
|
122
|
-
else
|
|
123
|
-
s_origin = nullptr;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
118
|
/*static*/ bool OriginPolicyHttpFilter::IsSameOrigin(Uri const &u1, Uri const &u2) noexcept {
|
|
127
119
|
return (u1 && u2) && u1.SchemeName() == u2.SchemeName() && u1.Host() == u2.Host() && u1.Port() == u2.Port();
|
|
128
120
|
}
|
|
@@ -160,8 +152,16 @@ bool OriginPolicyHttpFilter::CaseInsensitiveComparer::operator()(const wstring &
|
|
|
160
152
|
return s_simpleCorsMethods.find(request.Method().ToString().c_str()) != s_simpleCorsMethods.cend();
|
|
161
153
|
}
|
|
162
154
|
|
|
163
|
-
/*static*/
|
|
164
|
-
|
|
155
|
+
/*static*/ const hstring OriginPolicyHttpFilter::GetOrigin(Uri const &uri) noexcept {
|
|
156
|
+
auto const &scheme = uri.SchemeName();
|
|
157
|
+
auto port = uri.Port();
|
|
158
|
+
|
|
159
|
+
hstring result = scheme + L"://" + uri.Host();
|
|
160
|
+
if (!(port == 80 && scheme == L"http") && !(port == 443 && scheme == L"https")) {
|
|
161
|
+
result = result + L":" + to_hstring(port);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
return result;
|
|
165
165
|
}
|
|
166
166
|
|
|
167
167
|
/*static*/ bool OriginPolicyHttpFilter::AreSafeRequestHeaders(
|
|
@@ -379,10 +379,14 @@ bool OriginPolicyHttpFilter::CaseInsensitiveComparer::operator()(const wstring &
|
|
|
379
379
|
}
|
|
380
380
|
}
|
|
381
381
|
|
|
382
|
-
OriginPolicyHttpFilter::OriginPolicyHttpFilter(IHttpFilter const &innerFilter)
|
|
382
|
+
OriginPolicyHttpFilter::OriginPolicyHttpFilter(string &&origin, IHttpFilter const &innerFilter)
|
|
383
|
+
: m_origin{nullptr}, m_innerFilter{innerFilter} {
|
|
384
|
+
if (!origin.empty())
|
|
385
|
+
m_origin = Uri{to_hstring(origin)};
|
|
386
|
+
}
|
|
383
387
|
|
|
384
|
-
OriginPolicyHttpFilter::OriginPolicyHttpFilter()
|
|
385
|
-
: OriginPolicyHttpFilter(winrt::Windows::Web::Http::Filters::HttpBaseProtocolFilter{}) {}
|
|
388
|
+
OriginPolicyHttpFilter::OriginPolicyHttpFilter(string &&origin)
|
|
389
|
+
: OriginPolicyHttpFilter(std::move(origin), winrt::Windows::Web::Http::Filters::HttpBaseProtocolFilter{}) {}
|
|
386
390
|
|
|
387
391
|
OriginPolicy OriginPolicyHttpFilter::ValidateRequest(HttpRequestMessage const &request) {
|
|
388
392
|
auto effectiveOriginPolicy =
|
|
@@ -392,17 +396,17 @@ OriginPolicy OriginPolicyHttpFilter::ValidateRequest(HttpRequestMessage const &r
|
|
|
392
396
|
return effectiveOriginPolicy;
|
|
393
397
|
|
|
394
398
|
case OriginPolicy::SameOrigin:
|
|
395
|
-
if (!IsSameOrigin(
|
|
399
|
+
if (!IsSameOrigin(m_origin, request.RequestUri()))
|
|
396
400
|
throw hresult_error{E_INVALIDARG, L"SOP (same-origin policy) is enforced"};
|
|
397
401
|
break;
|
|
398
402
|
|
|
399
403
|
case OriginPolicy::SimpleCrossOriginResourceSharing:
|
|
400
404
|
// Check for disallowed mixed content
|
|
401
405
|
if (GetRuntimeOptionBool("Http.BlockMixedContentSimpleCors") &&
|
|
402
|
-
|
|
406
|
+
m_origin.SchemeName() != request.RequestUri().SchemeName())
|
|
403
407
|
throw hresult_error{E_INVALIDARG, L"The origin and request URLs must have the same scheme"};
|
|
404
408
|
|
|
405
|
-
if (IsSameOrigin(
|
|
409
|
+
if (IsSameOrigin(m_origin, request.RequestUri()))
|
|
406
410
|
// Same origin. Therefore, skip Cross-Origin handling.
|
|
407
411
|
effectiveOriginPolicy = OriginPolicy::SameOrigin;
|
|
408
412
|
else if (!IsSimpleCorsRequest(request))
|
|
@@ -418,7 +422,7 @@ OriginPolicy OriginPolicyHttpFilter::ValidateRequest(HttpRequestMessage const &r
|
|
|
418
422
|
// Example: On the Edge browser, an XHR request with the "Host" header set gets rejected as unsafe.
|
|
419
423
|
// https://fetch.spec.whatwg.org/#forbidden-header-name
|
|
420
424
|
|
|
421
|
-
if (
|
|
425
|
+
if (m_origin.SchemeName() != request.RequestUri().SchemeName())
|
|
422
426
|
throw hresult_error{E_INVALIDARG, L"The origin and request URLs must have the same scheme"};
|
|
423
427
|
|
|
424
428
|
if (!AreSafeRequestHeaders(request.Headers()))
|
|
@@ -427,7 +431,7 @@ OriginPolicy OriginPolicyHttpFilter::ValidateRequest(HttpRequestMessage const &r
|
|
|
427
431
|
if (s_forbiddenMethods.find(request.Method().ToString().c_str()) != s_forbiddenMethods.cend())
|
|
428
432
|
throw hresult_error{E_INVALIDARG, L"Request method not allowed in cross-origin resource sharing"};
|
|
429
433
|
|
|
430
|
-
if (IsSameOrigin(
|
|
434
|
+
if (IsSameOrigin(m_origin, request.RequestUri()))
|
|
431
435
|
effectiveOriginPolicy = OriginPolicy::SameOrigin;
|
|
432
436
|
else if (IsSimpleCorsRequest(request))
|
|
433
437
|
effectiveOriginPolicy = OriginPolicy::SimpleCrossOriginResourceSharing;
|
|
@@ -464,7 +468,7 @@ void OriginPolicyHttpFilter::ValidateAllowOrigin(
|
|
|
464
468
|
// 4.10.4 - Mismatched allow origin
|
|
465
469
|
auto taintedOriginProp = props.TryLookup(L"TaintedOrigin");
|
|
466
470
|
auto taintedOrigin = taintedOriginProp && winrt::unbox_value<bool>(taintedOriginProp);
|
|
467
|
-
auto origin = taintedOrigin ? nullptr :
|
|
471
|
+
auto origin = taintedOrigin ? nullptr : m_origin;
|
|
468
472
|
if (allowedOrigin.empty() || !IsSameOrigin(origin, Uri{allowedOrigin})) {
|
|
469
473
|
hstring errorMessage;
|
|
470
474
|
if (allowedOrigin.empty())
|
|
@@ -595,7 +599,7 @@ void OriginPolicyHttpFilter::ValidateResponse(HttpResponseMessage const &respons
|
|
|
595
599
|
bool originAllowed = false;
|
|
596
600
|
for (const auto &header : response.Headers()) {
|
|
597
601
|
if (boost::iequals(header.Key(), L"Access-Control-Allow-Origin")) {
|
|
598
|
-
originAllowed |= L"*" == header.Value() ||
|
|
602
|
+
originAllowed |= L"*" == header.Value() || m_origin == Uri{header.Value()};
|
|
599
603
|
}
|
|
600
604
|
}
|
|
601
605
|
|
|
@@ -683,7 +687,7 @@ ResponseOperation OriginPolicyHttpFilter::SendPreflightAsync(HttpRequestMessage
|
|
|
683
687
|
}
|
|
684
688
|
|
|
685
689
|
preflightRequest.Headers().Insert(L"Access-Control-Request-Headers", headerNames);
|
|
686
|
-
preflightRequest.Headers().Insert(L"Origin",
|
|
690
|
+
preflightRequest.Headers().Insert(L"Origin", GetOrigin(m_origin));
|
|
687
691
|
preflightRequest.Headers().Insert(L"Sec-Fetch-Mode", L"CORS");
|
|
688
692
|
|
|
689
693
|
co_return {co_await m_innerFilter.SendRequestAsync(preflightRequest)};
|
|
@@ -700,7 +704,7 @@ bool OriginPolicyHttpFilter::OnRedirecting(
|
|
|
700
704
|
// origin=http://a.com. Since the origin matches the URL, the request is authorized at http://a.com, but it actually
|
|
701
705
|
// allows http://b.com to bypass the CORS check at http://a.com since the redirected URL is from http://b.com.
|
|
702
706
|
if (!IsSameOrigin(response.Headers().Location(), request.RequestUri()) &&
|
|
703
|
-
!IsSameOrigin(
|
|
707
|
+
!IsSameOrigin(m_origin, request.RequestUri())) {
|
|
704
708
|
// By masking the origin field in the request header, we make it impossible for the server to set a single value for
|
|
705
709
|
// the access-control-allow-origin header. It means, the only way to support redirect is that server allows access
|
|
706
710
|
// from all sites through wildcard.
|
|
@@ -732,7 +736,7 @@ ResponseOperation OriginPolicyHttpFilter::SendRequestAsync(HttpRequestMessage co
|
|
|
732
736
|
// Allow only HTTP or HTTPS schemes
|
|
733
737
|
if (GetRuntimeOptionBool("Http.StrictScheme") && coRequest.RequestUri().SchemeName() != L"https" &&
|
|
734
738
|
coRequest.RequestUri().SchemeName() != L"http")
|
|
735
|
-
throw hresult_error{E_INVALIDARG, L"Invalid URL scheme: [" +
|
|
739
|
+
throw hresult_error{E_INVALIDARG, L"Invalid URL scheme: [" + m_origin.SchemeName() + L"]"};
|
|
736
740
|
|
|
737
741
|
if (!GetRuntimeOptionBool("Http.OmitCredentials")) {
|
|
738
742
|
coRequest.Properties().Lookup(L"RequestArgs").as<RequestArgs>()->WithCredentials = false;
|
|
@@ -769,7 +773,7 @@ ResponseOperation OriginPolicyHttpFilter::SendRequestAsync(HttpRequestMessage co
|
|
|
769
773
|
|
|
770
774
|
if (originPolicy == OriginPolicy::SimpleCrossOriginResourceSharing ||
|
|
771
775
|
originPolicy == OriginPolicy::CrossOriginResourceSharing) {
|
|
772
|
-
coRequest.Headers().Insert(L"Origin",
|
|
776
|
+
coRequest.Headers().Insert(L"Origin", GetOrigin(m_origin));
|
|
773
777
|
}
|
|
774
778
|
|
|
775
779
|
auto response = co_await m_innerFilter.SendRequestAsync(coRequest);
|
|
@@ -37,9 +37,6 @@ class OriginPolicyHttpFilter
|
|
|
37
37
|
static std::set<const wchar_t *, CaseInsensitiveComparer> s_corsForbiddenRequestHeaderNamePrefixes;
|
|
38
38
|
static std::set<const wchar_t *, CaseInsensitiveComparer> s_cookieSettingResponseHeaders;
|
|
39
39
|
|
|
40
|
-
// NOTE: Assumes static origin through owning client/resource/module/(React) instance's lifetime.
|
|
41
|
-
static winrt::Windows::Foundation::Uri s_origin;
|
|
42
|
-
|
|
43
40
|
struct AccessControlValues {
|
|
44
41
|
winrt::hstring AllowedOrigin;
|
|
45
42
|
winrt::hstring AllowedCredentials;
|
|
@@ -49,16 +46,16 @@ class OriginPolicyHttpFilter
|
|
|
49
46
|
size_t MaxAge;
|
|
50
47
|
};
|
|
51
48
|
|
|
49
|
+
winrt::Windows::Foundation::Uri m_origin;
|
|
50
|
+
|
|
52
51
|
winrt::Windows::Web::Http::Filters::IHttpFilter m_innerFilter;
|
|
53
52
|
|
|
54
53
|
public:
|
|
55
|
-
static void SetStaticOrigin(std::string &&url);
|
|
56
|
-
|
|
57
54
|
static bool IsSameOrigin(
|
|
58
55
|
winrt::Windows::Foundation::Uri const &u1,
|
|
59
56
|
winrt::Windows::Foundation::Uri const &u2) noexcept;
|
|
60
57
|
|
|
61
|
-
static winrt::
|
|
58
|
+
static const winrt::hstring GetOrigin(winrt::Windows::Foundation::Uri const &uri) noexcept;
|
|
62
59
|
|
|
63
60
|
static bool IsSimpleCorsRequest(winrt::Windows::Web::Http::HttpRequestMessage const &request) noexcept;
|
|
64
61
|
|
|
@@ -80,9 +77,9 @@ class OriginPolicyHttpFilter
|
|
|
80
77
|
winrt::Windows::Web::Http::HttpResponseMessage const &response,
|
|
81
78
|
bool removeAll);
|
|
82
79
|
|
|
83
|
-
OriginPolicyHttpFilter(winrt::Windows::Web::Http::Filters::IHttpFilter const &innerFilter);
|
|
80
|
+
OriginPolicyHttpFilter(std::string &&origin, winrt::Windows::Web::Http::Filters::IHttpFilter const &innerFilter);
|
|
84
81
|
|
|
85
|
-
OriginPolicyHttpFilter();
|
|
82
|
+
OriginPolicyHttpFilter(std::string &&origin);
|
|
86
83
|
|
|
87
84
|
OriginPolicy ValidateRequest(winrt::Windows::Web::Http::HttpRequestMessage const &request);
|
|
88
85
|
|
|
@@ -641,8 +641,7 @@ void WinRTHttpResource::AddResponseHandler(shared_ptr<IResponseHandler> response
|
|
|
641
641
|
|
|
642
642
|
#pragma region IHttpResource
|
|
643
643
|
|
|
644
|
-
/*static*/ shared_ptr<IHttpResource> IHttpResource::Make(
|
|
645
|
-
winrt::Windows::Foundation::IInspectable const &inspectableProperties) noexcept {
|
|
644
|
+
/*static*/ shared_ptr<IHttpResource> IHttpResource::Make(IInspectable const &inspectableProperties) noexcept {
|
|
646
645
|
using namespace winrt::Microsoft::ReactNative;
|
|
647
646
|
using winrt::Windows::Web::Http::HttpClient;
|
|
648
647
|
|
|
@@ -653,8 +652,7 @@ void WinRTHttpResource::AddResponseHandler(shared_ptr<IResponseHandler> response
|
|
|
653
652
|
client = HttpClient{redirFilter};
|
|
654
653
|
} else {
|
|
655
654
|
auto globalOrigin = GetRuntimeOptionString("Http.GlobalOrigin");
|
|
656
|
-
OriginPolicyHttpFilter
|
|
657
|
-
auto opFilter = winrt::make<OriginPolicyHttpFilter>(redirFilter);
|
|
655
|
+
auto opFilter = winrt::make<OriginPolicyHttpFilter>(std::move(globalOrigin), redirFilter);
|
|
658
656
|
redirFilter.as<RedirectHttpFilter>()->SetRedirectSource(opFilter.as<IRedirectEventSource>());
|
|
659
657
|
|
|
660
658
|
client = HttpClient{opFilter};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-windows",
|
|
3
|
-
"version": "0.73.
|
|
3
|
+
"version": "0.73.11",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -23,13 +23,13 @@
|
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"@babel/runtime": "^7.0.0",
|
|
25
25
|
"@jest/create-cache-key-function": "^29.6.3",
|
|
26
|
-
"@react-native-community/cli": "12.3.
|
|
27
|
-
"@react-native-community/cli-platform-android": "12.3.
|
|
28
|
-
"@react-native-community/cli-platform-ios": "12.3.
|
|
26
|
+
"@react-native-community/cli": "12.3.6",
|
|
27
|
+
"@react-native-community/cli-platform-android": "12.3.6",
|
|
28
|
+
"@react-native-community/cli-platform-ios": "12.3.6",
|
|
29
29
|
"@react-native-windows/cli": "0.73.2",
|
|
30
30
|
"@react-native/assets-registry": "0.73.1",
|
|
31
31
|
"@react-native/codegen": "0.73.3",
|
|
32
|
-
"@react-native/community-cli-plugin": "0.73.
|
|
32
|
+
"@react-native/community-cli-plugin": "0.73.17",
|
|
33
33
|
"@react-native/gradle-plugin": "0.73.4",
|
|
34
34
|
"@react-native/js-polyfills": "0.73.1",
|
|
35
35
|
"@react-native/normalize-colors": "0.73.2",
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
"just-scripts": "^1.3.3",
|
|
82
82
|
"prettier": "^2.4.1",
|
|
83
83
|
"react": "18.2.0",
|
|
84
|
-
"react-native": "0.73.
|
|
84
|
+
"react-native": "0.73.6",
|
|
85
85
|
"react-native-platform-override": "^1.9.16",
|
|
86
86
|
"react-refresh": "^0.4.0",
|
|
87
87
|
"typescript": "^4.9.5"
|