Skip to content

Conversation

@JunielKatarn
Copy link
Contributor

@JunielKatarn JunielKatarn commented Sep 16, 2022

Backport of #10534

Microsoft Reviewers: Open in CodeFlow

JunielKatarn and others added 3 commits September 16, 2022 13:50
* Define WinRTHttpResult::CreateRequest

* Use request produced by CreateRequest()

TODO: Have PerformSendRequest receive raw method and uri instead of
HttpRequestMessage.

* Exit if request is not created successfully

* Enabled FullCorsCrossOriginToAnotherCrossOriginRedirectWithPreflightSucceeds

* Single retry

* Add test RedirectPatchSucceeds

* Rename tests to SimpleRedirect<VERB>Succeeds

* Use method and URI intead of full HTTPReqMsg in PerformSendReq

* Move HttpResourceIntegrationTest into workspace

* Add WinInet-based test

* Get request complete variables

* Define RequestContext struct

* Get response content

* Add synchronization logic

* Refer CoreFX reference PR and version

* Disable SimpleRedirectWinInetSucceeds

* Define RedirectHttpFilter

- Meant to be the default internal filter for WinRTHttpResource.

* Use redirect filter for OP and default clients in factory

* Implement RedirectHttpFilter::SendRequestAsync

TODO: Deal with IDS_REQUEST_ALREADY_SENT by making CreateRequest coroutine available to both the resource and filter classes.

* Expose resource as IWinRTHttpRequestFactory

- Allows redir filter to access resource's request factory method.

* Re-arrange resource instantiation in Make factory

* Re-enable disabled Origin Policy tests

* Make redir filter constructors noexcept

* Attempt to implement IHttpBaseProtocolFilter

* Make redir filter implement IHttpBaseProtocolFilter

* Enable inheritance of IHttpBPFilter via unsetting WINRT_LEAN_AND_MEAN

* Implement IHttpBPfilter based on inner filter

* Add RedirHttpFilterUTs class

* Fix comment

* Consume mocks in MockBaseFilter

* Implement mocks in ManualRedirectSucceeds

* Implement manual redir test with coroutines

* Complete [Manual|Automatic]RedirectSucceeds

* Allow setting max redirect # in constructor
- Add test TooManyRedirectsFails

* Add test MaxAllowedRedirectsSucceeds

* Minor requestArgs factoring

* Define and consume IRedirectEventSource

* Add IRedirectEventSource.idl to unit test project

* Update Shared vcx filters

* Partially implement OPFilter::OnRedirecting

* Update Shared filters

* Make OPFilter drop redirection for preflights

* Allow empty string, non-null req content

* Allow non-movable responses in test server (OPIntTests)

* Always clear Http.OmitCredentials rt option

* Update outdated comment

* Removed commented code

* Clean up stale/commented code

* Throw E_INVALIDARG if redirect gets null request handle

* Throw ERROR_HTTP_REDIRECT_FAILED on too many redirects

* Remove/ignore incorrect tests

* clang format

* Change files

* Update packages lock

* Remove Redir filter constructor from DLL boundary

* Drop unused libs/include dirs

* Restore ut project IncludePath

* Remove /*const*/ comments from HTTP mocks

* Explicitly capture `constexpr`

Implicit capture only available starting MSVC 14.3

* Declare redirect counts as size_t

* Update packages.lock.json

* Update packages lock

* Replace IInspectable with WinRT IMap (request props) in CreateRequest

* Make TaintedOrigin a direct request property.

The `RequestArgs` struct should not hold Origin POlicy specific data.

* clang format

* Fix compilation of filter and resource in MSRN

* Rename local variables

* Fix relative include of WinRTTypes

* Simplify redirect count tests

* Propagate isTimeout to JS layer

* Comment alternative HRESULTs for timeout

* Address feedback for internal MIDL type

* Update packages lock

* Use std::stol to parse Content-Length

* Use constexpr for default max redirects

* Drop WinRT/Http/Filters header from PCH

- This prevents including the header with WINRT_LEAN_AND_MEAN macro conflict.
- Only DevSupportManager required it. Performance loss is negligible.

* Add interface IRedirectEventSource2

* Remove IDL IRedirectEventSource

* Rename IRedirectEventSource2 to IRedirectEventSource

* Revert packages lock

* Remove stale IDL reference

* Throw on RedirectHttpFilter::AllowUI
@JunielKatarn JunielKatarn requested review from a team as code owners September 16, 2022 21:31
@JunielKatarn JunielKatarn merged commit 4161b2c into microsoft:0.70-stable Sep 17, 2022
@JunielKatarn JunielKatarn deleted the cors-redir-70 branch September 17, 2022 01:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants