diff options
author | Jon Coppeard <jcoppeard@mozilla.com> | 2020-08-22 07:08:10 +0000 |
---|---|---|
committer | Moonchild <moonchild@palemoon.org> | 2020-08-22 07:08:10 +0000 |
commit | 073e914eba25e47e4cdeaa33e5bd4e999716866d (patch) | |
tree | c75d6404fd10198ef1433fd1f0bfbf0c96b7a6c7 /dom | |
parent | c04befb938a6ab861bce0246eab2d586c913ceb0 (diff) | |
download | uxp-073e914eba25e47e4cdeaa33e5bd4e999716866d.tar.gz |
Issue #618 - Don't mute errors for module scripts because they always use CORS
Diffstat (limited to 'dom')
-rw-r--r-- | dom/script/ScriptLoader.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/dom/script/ScriptLoader.cpp b/dom/script/ScriptLoader.cpp index 38649e1dd4..f903813907 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); |