diff options
author | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-04-03 19:50:55 +0200 |
---|---|---|
committer | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-04-03 19:50:55 +0200 |
commit | 3968897fb4b227b1a634700cbeaea715e58ac543 (patch) | |
tree | f07bc2a6ec5b759ba56180200070bc3485e52dee /dom/base/nsContentUtils.cpp | |
parent | dc8aad9b9dc6983bb88aa586f34d9db007840eb8 (diff) | |
download | UXP-3968897fb4b227b1a634700cbeaea715e58ac543.tar UXP-3968897fb4b227b1a634700cbeaea715e58ac543.tar.gz UXP-3968897fb4b227b1a634700cbeaea715e58ac543.tar.lz UXP-3968897fb4b227b1a634700cbeaea715e58ac543.tar.xz UXP-3968897fb4b227b1a634700cbeaea715e58ac543.zip |
Bug 1431095 - Change Content-Type-Options: nosniff allowed script MIME types to match the spec
Diffstat (limited to 'dom/base/nsContentUtils.cpp')
-rw-r--r-- | dom/base/nsContentUtils.cpp | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/dom/base/nsContentUtils.cpp b/dom/base/nsContentUtils.cpp index 02c6bf1de..ef87a250e 100644 --- a/dom/base/nsContentUtils.cpp +++ b/dom/base/nsContentUtils.cpp @@ -3717,11 +3717,15 @@ nsContentUtils::IsChildOfSameType(nsIDocument* aDoc) } bool -nsContentUtils::IsScriptType(const nsACString& aContentType) +nsContentUtils::IsPlainTextType(const nsACString& aContentType) { // NOTE: if you add a type here, add it to the CONTENTDLF_CATEGORIES // define in nsContentDLF.h as well. - return aContentType.EqualsLiteral(APPLICATION_JAVASCRIPT) || + return aContentType.EqualsLiteral(TEXT_PLAIN) || + aContentType.EqualsLiteral(TEXT_CSS) || + aContentType.EqualsLiteral(TEXT_CACHE_MANIFEST) || + aContentType.EqualsLiteral(TEXT_VTT) || + aContentType.EqualsLiteral(APPLICATION_JAVASCRIPT) || aContentType.EqualsLiteral(APPLICATION_XJAVASCRIPT) || aContentType.EqualsLiteral(TEXT_ECMASCRIPT) || aContentType.EqualsLiteral(APPLICATION_ECMASCRIPT) || @@ -3731,18 +3735,6 @@ nsContentUtils::IsScriptType(const nsACString& aContentType) } bool -nsContentUtils::IsPlainTextType(const nsACString& aContentType) -{ - // NOTE: if you add a type here, add it to the CONTENTDLF_CATEGORIES - // define in nsContentDLF.h as well. - return aContentType.EqualsLiteral(TEXT_PLAIN) || - aContentType.EqualsLiteral(TEXT_CSS) || - aContentType.EqualsLiteral(TEXT_CACHE_MANIFEST) || - aContentType.EqualsLiteral(TEXT_VTT) || - IsScriptType(aContentType); -} - -bool nsContentUtils::GetWrapperSafeScriptFilename(nsIDocument* aDocument, nsIURI* aURI, nsACString& aScriptURI, |