-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Make HTTP origin value an instance member #12821
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
f4a8bb9
ae7432e
12f5d8e
f6dd238
5eadcaa
ed1f285
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| { | ||
| "type": "prerelease", | ||
| "comment": "Make HTTP origin value an instance member", | ||
| "packageName": "react-native-windows", | ||
| "email": "julio.rocha@microsoft.com", | ||
| "dependentChangeType": "patch" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -641,8 +641,7 @@ void WinRTHttpResource::AddResponseHandler(shared_ptr<IResponseHandler> response | |
|
|
||
| #pragma region IHttpResource | ||
|
|
||
| /*static*/ shared_ptr<IHttpResource> IHttpResource::Make( | ||
| winrt::Windows::Foundation::IInspectable const &inspectableProperties) noexcept { | ||
| /*static*/ shared_ptr<IHttpResource> IHttpResource::Make(IInspectable const &inspectableProperties) noexcept { | ||
| using namespace winrt::Microsoft::ReactNative; | ||
| using winrt::Windows::Web::Http::HttpClient; | ||
|
|
||
|
|
@@ -653,8 +652,7 @@ void WinRTHttpResource::AddResponseHandler(shared_ptr<IResponseHandler> response | |
| client = HttpClient{redirFilter}; | ||
| } else { | ||
| auto globalOrigin = GetRuntimeOptionString("Http.GlobalOrigin"); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should add a public PropertyId, or a setter for ReactPropertyBag/ReactInstanceSettings to allow setting this option on a per instance basis. If someone wanted to have different origins for different RN instances there would still be a synchronization issue here. We still need the "legacy" GetRuntimeOptionString option for Office's non-abi code paths, but for public use this should all be done using ReactInstanceSettings.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can that be addressed in a follow-up PR? (I could use that to re-factor other property ID declarations that are done inefficiently). This fix is required ASAP.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sure |
||
| OriginPolicyHttpFilter::SetStaticOrigin(std::move(globalOrigin)); | ||
| auto opFilter = winrt::make<OriginPolicyHttpFilter>(redirFilter); | ||
| auto opFilter = winrt::make<OriginPolicyHttpFilter>(std::move(globalOrigin), redirFilter); | ||
| redirFilter.as<RedirectHttpFilter>()->SetRedirectSource(opFilter.as<IRedirectEventSource>()); | ||
|
|
||
| client = HttpClient{opFilter}; | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.