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

Unified Diff: third_party/WebKit/Source/core/html/HTMLIFrameElement.cpp

Issue 2372563002: Adding Embedding-CSP HTTP header (Closed)
Patch Set: ASCII DCHECK and a comment Created 4 years, 2 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/HTMLIFrameElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLIFrameElement.cpp b/third_party/WebKit/Source/core/html/HTMLIFrameElement.cpp
index 2735abb63182db1c6ea4ab6b382a18a4d2ad54db..bd19ff853c8aff215fc9703c273444f24058b286 100644
--- a/third_party/WebKit/Source/core/html/HTMLIFrameElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLIFrameElement.cpp
@@ -124,6 +124,14 @@ void HTMLIFrameElement::parseAttribute(const QualifiedName& name,
m_permissions->setValue(value);
} else if (RuntimeEnabledFeatures::embedderCSPEnforcementEnabled() &&
name == cspAttr) {
+ // TODO(amalika): add more robust validation of the value
+ if (!value.getString().containsOnlyASCII()) {
+ m_csp = nullAtom;
+ document().addConsoleMessage(ConsoleMessage::create(
+ OtherMessageSource, ErrorMessageLevel,
+ "'csp' attribute contains non-ASCII characters: " + value));
+ return;
+ }
AtomicString oldCSP = m_csp;
m_csp = value;
if (m_csp != oldCSP)
« no previous file with comments | « third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp ('k') | third_party/WebKit/Source/core/loader/FrameFetchContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698