Commit c0956edf authored by John Abd-El-Malek's avatar John Abd-El-Malek Committed by Commit Bot

Mark YouTube safe search header as CORS exempt.

Bug: 1085309
Change-Id: Idb58fa6e32de68c4b92760fcc8ca6298be0212f7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2216853
Auto-Submit: John Abd-El-Malek <jam@chromium.org>
Commit-Queue: Takashi Toyoshima <toyoshim@chromium.org>
Reviewed-by: default avatarTakashi Toyoshima <toyoshim@chromium.org>
Cr-Commit-Position: refs/heads/master@{#772585}
parent 4094adf1
...@@ -30,6 +30,8 @@ void GoogleURLLoaderThrottle::UpdateCorsExemptHeader( ...@@ -30,6 +30,8 @@ void GoogleURLLoaderThrottle::UpdateCorsExemptHeader(
network::mojom::NetworkContextParams* params) { network::mojom::NetworkContextParams* params) {
params->cors_exempt_header_list.push_back( params->cors_exempt_header_list.push_back(
safe_search_util::kGoogleAppsAllowedDomains); safe_search_util::kGoogleAppsAllowedDomains);
params->cors_exempt_header_list.push_back(
safe_search_util::kYouTubeRestrictHeaderName);
#if defined(OS_ANDROID) #if defined(OS_ANDROID)
params->cors_exempt_header_list.push_back(kCCTClientDataHeader); params->cors_exempt_header_list.push_back(kCCTClientDataHeader);
#endif #endif
...@@ -70,7 +72,7 @@ void GoogleURLLoaderThrottle::WillStartRequest( ...@@ -70,7 +72,7 @@ void GoogleURLLoaderThrottle::WillStartRequest(
dynamic_params_.youtube_restrict < dynamic_params_.youtube_restrict <
safe_search_util::YOUTUBE_RESTRICT_COUNT) { safe_search_util::YOUTUBE_RESTRICT_COUNT) {
safe_search_util::ForceYouTubeRestrict( safe_search_util::ForceYouTubeRestrict(
request->url, &request->headers, request->url, &request->cors_exempt_headers,
static_cast<safe_search_util::YouTubeRestrictMode>( static_cast<safe_search_util::YouTubeRestrictMode>(
dynamic_params_.youtube_restrict)); dynamic_params_.youtube_restrict));
} }
...@@ -125,7 +127,7 @@ void GoogleURLLoaderThrottle::WillRedirectRequest( ...@@ -125,7 +127,7 @@ void GoogleURLLoaderThrottle::WillRedirectRequest(
dynamic_params_.youtube_restrict < dynamic_params_.youtube_restrict <
safe_search_util::YOUTUBE_RESTRICT_COUNT) { safe_search_util::YOUTUBE_RESTRICT_COUNT) {
safe_search_util::ForceYouTubeRestrict( safe_search_util::ForceYouTubeRestrict(
redirect_info->new_url, modified_headers, redirect_info->new_url, modified_cors_exempt_headers,
static_cast<safe_search_util::YouTubeRestrictMode>( static_cast<safe_search_util::YouTubeRestrictMode>(
dynamic_params_.youtube_restrict)); dynamic_params_.youtube_restrict));
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment