mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Fix cookie exclusion for fetch CORS pre-flight requests (fixes #3596)
Cookies (and other credentials) will be excluded when appropriate by downgrading |credentials_mode| from kSameOrigin to kOmit. Improve logic for Origin header inclusion, including a fix for Referrer/Origin calculation in URLRequestJob::ComputeReferrerForPolicy when used with custom standard schemes. Specify correct CookiePartitionKeyCollection when loading cookies. To test: - Run tests from https://browseraudit.com/ with and without `--disable-request-handling-for-testing`. Results are the same. - Run `ceftests --gtest_filter=CorsTest.*`.
This commit is contained in:
@@ -49,6 +49,9 @@ bool CefSchemeRegistrarImpl::AddCustomScheme(const CefString& scheme_name,
|
||||
// with Blink only.
|
||||
if (is_standard) {
|
||||
schemes_.standard_schemes.push_back(scheme);
|
||||
if (!is_local && !is_display_isolated) {
|
||||
schemes_.referrer_schemes.push_back(scheme);
|
||||
}
|
||||
}
|
||||
if (is_local) {
|
||||
schemes_.local_schemes.push_back(scheme);
|
||||
@@ -74,6 +77,7 @@ bool CefSchemeRegistrarImpl::AddCustomScheme(const CefString& scheme_name,
|
||||
void CefSchemeRegistrarImpl::GetSchemes(
|
||||
content::ContentClient::Schemes* schemes) {
|
||||
AppendArray(schemes_.standard_schemes, &schemes->standard_schemes);
|
||||
AppendArray(schemes_.referrer_schemes, &schemes->referrer_schemes);
|
||||
AppendArray(schemes_.local_schemes, &schemes->local_schemes);
|
||||
AppendArray(schemes_.secure_schemes, &schemes->secure_schemes);
|
||||
AppendArray(schemes_.cors_enabled_schemes, &schemes->cors_enabled_schemes);
|
||||
|
Reference in New Issue
Block a user