diff --git a/lib/common/options.js b/lib/common/options.js index 7d6b952f4b..614aa5ca10 100755 --- a/lib/common/options.js +++ b/lib/common/options.js @@ -34,9 +34,6 @@ Options.from = function (_options) { if (typeof options.extensions === 'string') { options.extensions = [ options.extensions ] } - if (options.render.csp === true) { - options.render.csp = { hashAlgorithm: 'sha256' } - } const hasValue = v => typeof v === 'string' && v options.rootDir = hasValue(options.rootDir) ? options.rootDir : process.cwd() @@ -90,6 +87,11 @@ Options.from = function (_options) { if (!isPureObject(options.loadingIndicator)) { options.loadingIndicator = { name: options.loadingIndicator } } + + // Apply default hash to CSP option + if (options.render.csp === true) { + options.render.csp = { hashAlgorithm: 'sha256' } + } // Apply defaults to loadingIndicator options.loadingIndicator = Object.assign({