I am using Yii2 https://github.com/tomlutzenberger/yii2-smartsupp-chat widget which is working pretty fine but it is not able to record videos in their website and they have suggest to add something called as CSP.
https://help.smartlook.com/en/articles/3470377-content-security-policy-csp-smartlook
Could anyone suggest where & how exactly below code will be added ?
Content-Security-Policy: default-src 'self'; script-src 'self' https://*.smartlook.com https://*.smartlook.cloud 'nonce-randomlyGeneratedBase64Nonce' 'unsafe-eval'; connect-src 'self' https://*.smartlook.com https://*.smartlook.cloud; worker-src 'self' blob:
<script nonce="randomlyGeneratedBase64Nonce">...Your Smartlook Tracking Script...</script>
Suggested By @F Baghi
$randomNonce = Yii::$app->security->generateRandomString(64);
$nonce = "nonce-$randomNonce";
$hostSubdomains = "https://*.smartlook.com https://*.smartlook.cloud";
Yii::$app->response->headers->add(
'Content-Security-Policy',
"default-src 'self'; script-src 'self' $hostSubdomains $nonce 'unsafe-eval'; connect-src 'self' $hostSubdomains; worker-src 'self' blob"
);