Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: cherry-pick c643d18a078d from chromium (#35271)
* chore: cherry-pick c643d18a078d from chromium * chore: update patches Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
- Loading branch information
1 parent
c48905a
commit a0ea679
Showing
2 changed files
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
From: Rayan Kanso <rayankans@google.com> | ||
Date: Tue, 7 Jun 2022 13:13:36 +0000 | ||
Subject: Don't expose URL chain in case of CO redirect | ||
|
||
Bug: 1278255 | ||
Change-Id: If853327b853e29792e5c8d1dfaeecf21d6fec004 | ||
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3693143 | ||
Reviewed-by: Susanne Westphal <swestphal@google.com> | ||
Commit-Queue: Rayan Kanso <rayankans@chromium.org> | ||
Cr-Commit-Position: refs/heads/main@{#1011409} | ||
|
||
diff --git a/content/browser/background_fetch/storage/mark_request_complete_task.cc b/content/browser/background_fetch/storage/mark_request_complete_task.cc | ||
index 32a818ba8723f020fa536eb93a31c16b76ed92a1..d729dfc5d505c4c23872ef535a8b09f1af065914 100644 | ||
--- a/content/browser/background_fetch/storage/mark_request_complete_task.cc | ||
+++ b/content/browser/background_fetch/storage/mark_request_complete_task.cc | ||
@@ -104,6 +104,8 @@ void MarkRequestCompleteTask::StoreResponse(base::OnceClosure done_closure) { | ||
BackgroundFetchCrossOriginFilter filter( | ||
registration_id_.storage_key().origin(), *request_info_); | ||
if (!filter.CanPopulateBody()) { | ||
+ // Don't expose the initial URL in case of cross-origin redirects. | ||
+ response_->url_list.resize(1); | ||
failure_reason_ = proto::BackgroundFetchRegistration::FETCH_ERROR; | ||
// No point writing the response to the cache since it won't be exposed. | ||
CreateAndStoreCompletedRequest(std::move(done_closure)); |