chore: fix type check

csp is not boolean but typed as boolean. we need to fix schema.
This commit is contained in:
Pooya Parsa 2022-08-26 13:03:48 +02:00
parent c79d2bc43d
commit 80875b7960
1 changed files with 2 additions and 1 deletions

View File

@ -97,7 +97,8 @@ function clientPlugins (ctx: WebpackConfigContext) {
}
function getCspScriptPolicy (ctx: WebpackConfigContext) {
const { csp } = ctx.options.render
// TODO
const { csp } = ctx.options.render as any
if (typeof csp === 'object') {
const { policies = {} } = csp
return policies['script-src'] || policies['default-src'] || []