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

Unified Diff: third_party/WebKit/Source/core/html/parser/PreloadRequest.cpp

Issue 2780533002: Use Referrer-Policy headers for CSS stylesheets (Closed)
Patch Set: updates Created 3 years, 9 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/html/parser/PreloadRequest.cpp
diff --git a/third_party/WebKit/Source/core/html/parser/PreloadRequest.cpp b/third_party/WebKit/Source/core/html/parser/PreloadRequest.cpp
index d1694840a858ca62db070766c915320018d1a0c6..5c83e5328cffbb73461ac5daceeb3c2a6a1fce04 100644
--- a/third_party/WebKit/Source/core/html/parser/PreloadRequest.cpp
+++ b/third_party/WebKit/Source/core/html/parser/PreloadRequest.cpp
@@ -40,7 +40,10 @@ Resource* PreloadRequest::start(Document* document) {
ResourceRequest resourceRequest(url);
resourceRequest.setHTTPReferrer(SecurityPolicy::generateReferrer(
- m_referrerPolicy, url, document->outgoingReferrer()));
+ m_referrerPolicy, url,
+ m_resourceType == Resource::CSSStyleSheet
+ ? m_baseURL.strippedForUseAsReferrer()
+ : document->outgoingReferrer()));
resourceRequest.setRequestContext(
ResourceFetcher::determineRequestContext(m_resourceType, false));

Powered by Google App Engine
This is Rietveld 408576698