diff options
author | Jon Coppeard <jcoppeard@mozilla.com> | 2020-08-22 07:08:10 +0000 |
---|---|---|
committer | Moonchild <moonchild@palemoon.org> | 2020-08-30 09:38:44 +0000 |
commit | b9af9c0c5168044f033a4a42ec3ee2ea7741ce4b (patch) | |
tree | 4a004d684ba113b8098b6d53a1dbda88011e4275 /dom/script | |
parent | 9d6e28d3d0de8ddf5e482f7938822214f4da22ba (diff) | |
download | UXP-b9af9c0c5168044f033a4a42ec3ee2ea7741ce4b.tar UXP-b9af9c0c5168044f033a4a42ec3ee2ea7741ce4b.tar.gz UXP-b9af9c0c5168044f033a4a42ec3ee2ea7741ce4b.tar.lz UXP-b9af9c0c5168044f033a4a42ec3ee2ea7741ce4b.tar.xz UXP-b9af9c0c5168044f033a4a42ec3ee2ea7741ce4b.zip |
Issue #618 - Don't mute errors for module scripts because they always use CORS
Diffstat (limited to 'dom/script')
-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 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); |