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

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

Issue 1617043002: Introduce AncestorThrottle, which will process 'X-Frame-Options' headers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@block-response
Patch Set: Fix. Created 4 years, 8 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/DocumentLoader.cpp
diff --git a/third_party/WebKit/Source/core/loader/DocumentLoader.cpp b/third_party/WebKit/Source/core/loader/DocumentLoader.cpp
index 3e50fc12e4ae23014f86ea22e7aca852be85f8e4..0f39da1fd3f449e3720795b8944ed638be26ec51 100644
--- a/third_party/WebKit/Source/core/loader/DocumentLoader.cpp
+++ b/third_party/WebKit/Source/core/loader/DocumentLoader.cpp
@@ -389,23 +389,6 @@ void DocumentLoader::responseReceived(Resource* resource, const ResourceResponse
return;
}
- // 'frame-ancestors' obviates 'x-frame-options': https://w3c.github.io/webappsec/specs/content-security-policy/#frame-ancestors-and-frame-options
- if (!m_contentSecurityPolicy->isFrameAncestorsEnforced()) {
- HTTPHeaderMap::const_iterator it = response.httpHeaderFields().find(HTTPNames::X_Frame_Options);
- if (it != response.httpHeaderFields().end()) {
- String content = it->value;
- if (frameLoader()->shouldInterruptLoadForXFrameOptions(content, response.url(), mainResourceIdentifier())) {
- String message = "Refused to display '" + response.url().elidedString() + "' in a frame because it set 'X-Frame-Options' to '" + content + "'.";
- ConsoleMessage* consoleMessage = ConsoleMessage::create(SecurityMessageSource, ErrorMessageLevel, message);
- consoleMessage->setRequestIdentifier(mainResourceIdentifier());
- frame()->document()->addConsoleMessage(consoleMessage);
-
- cancelLoadAfterXFrameOptionsOrCSPDenied(response);
- return;
- }
- }
- }
-
ASSERT(!m_frame->page()->defersLoading());
m_response = response;

Powered by Google App Engine
This is Rietveld 408576698