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

Unified Diff: third_party/WebKit/Source/core/loader/FrameFetchContext.cpp

Issue 1632523002: `<link rel=preload>` with no `as` should be subject to connect-src (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix unit tests Created 4 years, 11 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
Index: third_party/WebKit/Source/core/loader/FrameFetchContext.cpp
diff --git a/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp b/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp
index 27d73c65b884d366ba098736c80de34c6a78dd87..9b12aece7043fed61f8d2b8b004e0625a6f36f1d 100644
--- a/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp
+++ b/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp
@@ -428,6 +428,7 @@ ResourceRequestBlockedReason FrameFetchContext::canRequestInternal(Resource::Typ
case Resource::Font:
case Resource::Raw:
case Resource::LinkPrefetch:
+ case Resource::LinkPreload:
case Resource::LinkSubresource:
case Resource::TextTrack:
case Resource::ImportResource:
@@ -505,6 +506,11 @@ ResourceRequestBlockedReason FrameFetchContext::canRequestInternal(Resource::Typ
return ResourceRequestBlockedReasonCSP;
break;
}
+ case Resource::LinkPreload:
+ ASSERT(csp);
+ if (!shouldBypassMainWorldCSP && !csp->allowConnectToSource(url, redirectStatus, cspReporting))
+ return ResourceRequestBlockedReasonCSP;
+ break;
case Resource::MainResource:
case Resource::Raw:
case Resource::LinkPrefetch:
« no previous file with comments | « third_party/WebKit/Source/core/loader/DocumentLoader.cpp ('k') | third_party/WebKit/Source/core/loader/LinkLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698