Bug 1431095 - Change Content-Type-Options: nosniff allowed script MIME types to match the spec

This commit is contained in:
janekptacijarabaci 2018-04-03 19:50:55 +02:00 committed by Roy Tam
commit 8f4e22e819
4 changed files with 10 additions and 23 deletions

View file

@ -1152,7 +1152,7 @@ ProcessXCTO(nsIURI* aURI, nsHttpResponseHead* aResponseHead, nsILoadInfo* aLoadI
}
if (aLoadInfo->GetExternalContentPolicyType() == nsIContentPolicy::TYPE_SCRIPT) {
if (nsContentUtils::IsScriptType(contentType)) {
if (nsContentUtils::IsJavascriptMIMEType(NS_ConvertUTF8toUTF16(contentType))) {
return NS_OK;
}
ReportTypeBlocking(aURI, aLoadInfo, "MimeTypeMismatch");