Skip to content

Commit

Permalink
Merge pull request #1158 from izaera/amd-loader-csp-fix
Browse files Browse the repository at this point in the history
fix(amd-loader): don't emit the nonce if it is empty
  • Loading branch information
izaera authored Aug 4, 2023
2 parents d63908c + 373b696 commit 4d01145
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
5 changes: 4 additions & 1 deletion projects/amd-loader/src/loader/script-loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,10 @@ export default class ScriptLoader {

script.src = modulesURL.url;
script.async = false;
script.setAttribute('nonce', config.nonce);

if (config.nonce) {
script.setAttribute('nonce', config.nonce);
}

if (modulesURL.useESM) {
script.type = config.moduleType;
Expand Down
16 changes: 16 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1430,6 +1430,22 @@
"@types/yargs" "^16.0.0"
chalk "^4.0.0"

"@liferay/eslint-plugin@1.4.0":
version "1.4.0"
resolved "https://registry.yarnpkg.com/@liferay/eslint-plugin/-/eslint-plugin-1.4.0.tgz#fabc93c0c4d2997714713ce490f278e700205206"
integrity sha512-UKqa4Dp2vQgSnndBYKY/eF+o02NS419H18D5CWp+bbZ5o81Oka0+K2ybLrQgLGnES15jMZUG4cNHWI63tOXsVw==
dependencies:
"@typescript-eslint/eslint-plugin" "4.30.0"
"@typescript-eslint/parser" "4.30.0"
eslint-config-prettier "8.1.0"
eslint-plugin-no-for-of-loops "^1.0.0"
eslint-plugin-no-only-tests "^2.1.0"
eslint-plugin-notice "0.9.10"
eslint-plugin-promise "^5.1.0"
eslint-plugin-react "7.23.1"
eslint-plugin-react-hooks "4.2.0"
eslint-plugin-sort-destructure-keys "^1.3.5"

"@liferay/js-toolkit-core@3.0.1":
version "3.0.1"
resolved "https://registry.yarnpkg.com/@liferay/js-toolkit-core/-/js-toolkit-core-3.0.1.tgz#1232febc41b17da00cd12f7de4eba7243df8c18d"
Expand Down

0 comments on commit 4d01145

Please sign in to comment.