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

Unified Diff: Source/core/frame/csp/ContentSecurityPolicy.cpp

Issue 811703006: Added more useful message error message for plugin-types CSP directive. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: plugin-types error msg improvement Created 5 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: Source/core/frame/csp/ContentSecurityPolicy.cpp
diff --git a/Source/core/frame/csp/ContentSecurityPolicy.cpp b/Source/core/frame/csp/ContentSecurityPolicy.cpp
index 95e23db3167cc0faa62f7c2d8c9f89703e2477ff..646cfcbc97f3e4b82022999e7d530eb4b1d58c85 100644
--- a/Source/core/frame/csp/ContentSecurityPolicy.cpp
+++ b/Source/core/frame/csp/ContentSecurityPolicy.cpp
@@ -792,6 +792,8 @@ void ContentSecurityPolicy::reportInvalidPluginTypes(const String& pluginType)
String message;
if (pluginType.isNull())
message = "'plugin-types' Content Security Policy directive is empty; all plugins will be blocked.\n";
+ else if (pluginType == "'none'")
+ message = "Invalid plugin type in 'plugin-types' Content Security Policy directive: '" + pluginType + "'. Did you mean to set the object-src directive to 'none'?\n";
else
message = "Invalid plugin type in 'plugin-types' Content Security Policy directive: '" + pluginType + "'.\n";
logToConsole(message);

Powered by Google App Engine
This is Rietveld 408576698