| Index: third_party/WebKit/Source/core/dom/ScriptLoader.cpp
|
| diff --git a/third_party/WebKit/Source/core/dom/ScriptLoader.cpp b/third_party/WebKit/Source/core/dom/ScriptLoader.cpp
|
| index 3c86d583090ca87516a32e8965eba6611c283906..a89f7df4387c5f1ba1c51a6dc57a314d0a71e1e0 100644
|
| --- a/third_party/WebKit/Source/core/dom/ScriptLoader.cpp
|
| +++ b/third_party/WebKit/Source/core/dom/ScriptLoader.cpp
|
| @@ -376,13 +376,13 @@ bool ScriptLoader::executeScript(const ScriptSourceCode& sourceCode, double* com
|
| ScriptResource* resource = m_resource ? m_resource.get() : sourceCode.resource();
|
| if (resource) {
|
| if (!resource->mimeTypeAllowedByNosniff()) {
|
| - contextDocument->addConsoleMessage(ConsoleMessage::create(SecurityMessageSource, ErrorMessageLevel, "Refused to execute script from '" + resource->url().elidedString() + "' because its MIME type ('" + resource->mimeType() + "') is not executable, and strict MIME type checking is enabled."));
|
| + contextDocument->addConsoleMessage(ConsoleMessage::create(SecurityMessageSource, ErrorMessageLevel, "Refused to execute script from '" + resource->url().elidedString() + "' because its MIME type ('" + resource->httpContentType() + "') is not executable, and strict MIME type checking is enabled."));
|
| return false;
|
| }
|
|
|
| - String mimetype = resource->mimeType();
|
| - if (mimetype.lower().startsWith("image/")) {
|
| - contextDocument->addConsoleMessage(ConsoleMessage::create(SecurityMessageSource, ErrorMessageLevel, "Refused to execute script from '" + resource->url().elidedString() + "' because its MIME type ('" + resource->mimeType() + "') is not executable."));
|
| + String mimetype = resource->httpContentType();
|
| + if (mimetype.startsWith("image/")) {
|
| + contextDocument->addConsoleMessage(ConsoleMessage::create(SecurityMessageSource, ErrorMessageLevel, "Refused to execute script from '" + resource->url().elidedString() + "' because its MIME type ('" + mimetype + "') is not executable."));
|
| UseCounter::count(frame, UseCounter::BlockedSniffingImageToScript);
|
| return false;
|
| }
|
|
|