summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJon Coppeard <jcoppeard@mozilla.com>2020-08-22 07:08:10 +0000
committerMoonchild <moonchild@palemoon.org>2020-08-22 07:08:10 +0000
commit073e914eba25e47e4cdeaa33e5bd4e999716866d (patch)
treec75d6404fd10198ef1433fd1f0bfbf0c96b7a6c7
parentc04befb938a6ab861bce0246eab2d586c913ceb0 (diff)
downloadUXP-073e914eba25e47e4cdeaa33e5bd4e999716866d.tar
UXP-073e914eba25e47e4cdeaa33e5bd4e999716866d.tar.gz
UXP-073e914eba25e47e4cdeaa33e5bd4e999716866d.tar.lz
UXP-073e914eba25e47e4cdeaa33e5bd4e999716866d.tar.xz
UXP-073e914eba25e47e4cdeaa33e5bd4e999716866d.zip
Issue #618 - Don't mute errors for module scripts because they always use CORS
-rw-r--r--dom/script/ScriptLoader.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/dom/script/ScriptLoader.cpp b/dom/script/ScriptLoader.cpp
index 38649e1dd..f90381390 100644
--- a/dom/script/ScriptLoader.cpp
+++ b/dom/script/ScriptLoader.cpp
@@ -2446,10 +2446,10 @@ ScriptLoader::PrepareLoadedRequest(ScriptLoadRequest* aRequest,
}
nsCOMPtr<nsIChannel> channel = do_QueryInterface(req);
- // If this load was subject to a CORS check; don't flag it with a
- // separate origin principal, so that it will treat our document's
- // principal as the origin principal
- if (aRequest->mCORSMode == CORS_NONE) {
+ // If this load was subject to a CORS check, don't flag it with a separate
+ // origin principal, so that it will treat our document's principal as the
+ // origin principal. Module loads always use CORS.
+ if (!aRequest->IsModuleRequest() && aRequest->mCORSMode == CORS_NONE) {
rv = nsContentUtils::GetSecurityManager()->
GetChannelResultPrincipal(channel, getter_AddRefs(aRequest->mOriginPrincipal));
NS_ENSURE_SUCCESS(rv, rv);