From b703ed2b79bbdbaa5d3d1755cb012e745408df00 Mon Sep 17 00:00:00 2001 From: Sherry Zhou Date: Fri, 26 Apr 2024 02:26:21 +0800 Subject: [PATCH] Remove net::LOAD_DO_NOT_SEND_COOKIES and net::LOAD_DO_NOT_SEND_AUTH_DATA (#3072) b/336799788 (cherry picked from commit 2ccd1d1f9869db0e6e3ca30d5bf391eb68be0e5b) --- cobalt/build/cobalt_configuration.py | 1 - cobalt/updater/network_fetcher.cc | 4 +--- cobalt/xhr/xml_http_request.cc | 6 ++---- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/cobalt/build/cobalt_configuration.py b/cobalt/build/cobalt_configuration.py index e34b25d3dd23..7c287fc0f41a 100644 --- a/cobalt/build/cobalt_configuration.py +++ b/cobalt/build/cobalt_configuration.py @@ -138,7 +138,6 @@ def GetWebPlatformTestFilters(self): 'websockets/WebPlatformTest.Run/websockets_opening_handshake_005_html', 'service_workers/WebPlatformTest.Run/service_workers_service_worker_register_wait_forever_in_install_worker_https_html', 'csp/WebPlatformTest.Run/content_security_policy_script_src_script_src_1_10_1_html', - 'cors/WebPlatformTest.Run/cors_credentials_flag_htm', 'html/WebPlatformTest.Run/html_dom_documents_dom_tree_accessors_Document_currentScript_sub_html', ] return filters diff --git a/cobalt/updater/network_fetcher.cc b/cobalt/updater/network_fetcher.cc index 761c5b3d6884..45b702800866 100644 --- a/cobalt/updater/network_fetcher.cc +++ b/cobalt/updater/network_fetcher.cc @@ -233,11 +233,9 @@ void NetworkFetcher::CreateUrlFetcher( // Request mode is kCORSModeOmitCredentials. const uint32 kDisableCookiesAndCacheLoadFlags = net::LOAD_NORMAL | net::LOAD_DO_NOT_SAVE_COOKIES | -#ifndef COBALT_PENDING_CLEAN_UP - net::LOAD_DO_NOT_SEND_COOKIES | net::LOAD_DO_NOT_SEND_AUTH_DATA | -#endif net::LOAD_DISABLE_CACHE; url_fetcher_->SetLoadFlags(kDisableCookiesAndCacheLoadFlags); + url_fetcher_->SetAllowCredentials(false); url_fetcher_->SetAutomaticallyRetryOnNetworkChanges( kMaxRetriesOnNetworkChange); diff --git a/cobalt/xhr/xml_http_request.cc b/cobalt/xhr/xml_http_request.cc index 1325353d961b..667301b07b5b 100644 --- a/cobalt/xhr/xml_http_request.cc +++ b/cobalt/xhr/xml_http_request.cc @@ -1457,12 +1457,10 @@ void XMLHttpRequestImpl::StartRequest(const std::string& request_body) { // To make a cross-origin request, add origin, referrer source, credentials, // omit credentials flag, force preflight flag if (!with_credentials_) { -#ifndef COBALT_PENDING_CLEAN_UP const uint32 kDisableCookiesLoadFlags = - net::LOAD_NORMAL | net::LOAD_DO_NOT_SAVE_COOKIES | - net::LOAD_DO_NOT_SEND_COOKIES | net::LOAD_DO_NOT_SEND_AUTH_DATA; + net::LOAD_NORMAL | net::LOAD_DO_NOT_SAVE_COOKIES; url_fetcher_->SetLoadFlags(kDisableCookiesLoadFlags); -#endif + url_fetcher_->SetAllowCredentials(false); } else { // For credentials mode: If the withCredentials attribute value is true, // "include", and "same-origin" otherwise.