Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1765)

Unified Diff: content/browser/service_worker/foreign_fetch_request_handler.cc

Issue 2032653003: Limit foreign fetch to only intercept requests made from secure contexts. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: properly initialize new ResourceRequest member Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/service_worker/foreign_fetch_request_handler.h ('k') | content/child/request_extra_data.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/service_worker/foreign_fetch_request_handler.cc
diff --git a/content/browser/service_worker/foreign_fetch_request_handler.cc b/content/browser/service_worker/foreign_fetch_request_handler.cc
index 59fe4846dfdedca40e239a131337244232f20f80..c712064a0b839da17636abf67ff3286bda5f20c7 100644
--- a/content/browser/service_worker/foreign_fetch_request_handler.cc
+++ b/content/browser/service_worker/foreign_fetch_request_handler.cc
@@ -58,11 +58,15 @@ void ForeignFetchRequestHandler::InitializeHandler(
ResourceType resource_type,
RequestContextType request_context_type,
RequestContextFrameType frame_type,
- scoped_refptr<ResourceRequestBody> body) {
+ scoped_refptr<ResourceRequestBody> body,
+ bool initiated_in_secure_context) {
if (!context_wrapper) {
return;
}
+ if (!initiated_in_secure_context)
+ return;
+
if (!context_wrapper->OriginHasForeignFetchRegistrations(
request->url().GetOrigin())) {
return;
@@ -70,6 +74,7 @@ void ForeignFetchRequestHandler::InitializeHandler(
if (request->initiator().IsSameOriginWith(url::Origin(request->url())))
return;
+
if (ServiceWorkerUtils::IsMainResourceType(resource_type))
return;
« no previous file with comments | « content/browser/service_worker/foreign_fetch_request_handler.h ('k') | content/child/request_extra_data.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698