How to whitelist dynamically created scripts in a WebForms project using CSP (Content Security Policy)?
问题 Is there a secure way of whitelisting dynamically created scripts in a WebForms project using CSP (Content Security Policy)? Using unsafe-inline like below it works but not recommended. context.Response.Headers.Append("Content-Security-Policy", string.Format("default-src 'none'; connect-src 'self'; font-src 'self'; img-src 'self' data: https:; style-src 'self'; script-src 'self' 'unsafe-inline'")); For any other options such as nonce-(random) , we see this CSP error message: Refused to