| Index: Source/core/frame/ContentSecurityPolicy.cpp
|
| diff --git a/Source/core/frame/ContentSecurityPolicy.cpp b/Source/core/frame/ContentSecurityPolicy.cpp
|
| index 2c92383d5100dd9152ac31be0649955fdd203e9a..a0ad8511071018eeeefbb03b4a489733b533f4ca 100644
|
| --- a/Source/core/frame/ContentSecurityPolicy.cpp
|
| +++ b/Source/core/frame/ContentSecurityPolicy.cpp
|
| @@ -1097,8 +1097,10 @@ bool CSPDirectiveList::checkInlineAndReportViolation(SourceListDirective* direct
|
| if (directive->allowInline() && directive->isHashOrNoncePresent()) {
|
| // If inline is allowed, but a hash or nonce is present, we ignore 'unsafe-inline'. Throw a reasonable error.
|
| suffix = " Note that 'unsafe-inline' is ignored if either a hash or nonce value is present in the source list.";
|
| - } else if (directive == m_defaultSrc) {
|
| - suffix = " Note that '" + String(isScript ? "script" : "style") + "-src' was not explicitly set, so 'default-src' is used as a fallback.";
|
| + } else {
|
| + suffix = " Either the 'unsafe-inline' keyword, a hash ('sha256-...'), or a nonce ('nonce-...') is required to enable inline execution.";
|
| + if (directive == m_defaultSrc)
|
| + suffix = suffix + " Note also that '" + String(isScript ? "script" : "style") + "-src' was not explicitly set, so 'default-src' is used as a fallback.";
|
| }
|
|
|
| reportViolationWithLocation(directive->text(), isScript ? scriptSrc : styleSrc, consoleMessage + "\"" + directive->text() + "\"." + suffix + "\n", KURL(), contextURL, contextLine);
|
|
|