Index: Source/core/loader/FrameLoader.cpp |
diff --git a/Source/core/loader/FrameLoader.cpp b/Source/core/loader/FrameLoader.cpp |
index 2ae9b9f1f0236c5614ce0981d051f1367877cac0..af6ce6e5c0d3ca041fb34de2ad52fe459e44ec84 100644 |
--- a/Source/core/loader/FrameLoader.cpp |
+++ b/Source/core/loader/FrameLoader.cpp |
@@ -536,7 +536,7 @@ void FrameLoader::didBeginDocument(bool dispatch) |
if (dispatch) |
dispatchDidClearWindowObjectsInAllWorlds(); |
- m_frame->document()->initContentSecurityPolicy(); |
+ m_frame->document()->initContentSecurityPolicy(m_documentLoader ? ContentSecurityPolicyResponseHeaders(m_documentLoader->response()) : ContentSecurityPolicyResponseHeaders()); |
Settings* settings = m_frame->document()->settings(); |
if (settings) { |
@@ -549,22 +549,6 @@ void FrameLoader::didBeginDocument(bool dispatch) |
if (!dnsPrefetchControl.isEmpty()) |
m_frame->document()->parseDNSPrefetchControlHeader(dnsPrefetchControl); |
- String policyValue = m_documentLoader->response().httpHeaderField("Content-Security-Policy"); |
- if (!policyValue.isEmpty()) |
- m_frame->document()->contentSecurityPolicy()->didReceiveHeader(policyValue, ContentSecurityPolicy::Enforce); |
- |
- policyValue = m_documentLoader->response().httpHeaderField("Content-Security-Policy-Report-Only"); |
- if (!policyValue.isEmpty()) |
- m_frame->document()->contentSecurityPolicy()->didReceiveHeader(policyValue, ContentSecurityPolicy::Report); |
- |
- policyValue = m_documentLoader->response().httpHeaderField("X-WebKit-CSP"); |
- if (!policyValue.isEmpty()) |
- m_frame->document()->contentSecurityPolicy()->didReceiveHeader(policyValue, ContentSecurityPolicy::PrefixedEnforce); |
- |
- policyValue = m_documentLoader->response().httpHeaderField("X-WebKit-CSP-Report-Only"); |
- if (!policyValue.isEmpty()) |
- m_frame->document()->contentSecurityPolicy()->didReceiveHeader(policyValue, ContentSecurityPolicy::PrefixedReport); |
- |
String headerContentLanguage = m_documentLoader->response().httpHeaderField("Content-Language"); |
if (!headerContentLanguage.isEmpty()) { |
size_t commaIndex = headerContentLanguage.find(','); |