I have a problem with Content Security Policy. Whenever I trying to include the JavaScript into my project, I get an content-security-policy error.
<!DOCTYPE html>
<html>
<head>
<title>Symfony</title>
<script src="{{ asset('myscript.js') }}"></script>
</head>
<body>
// ...
</body>
</html>
What am I doing wrong?
I've already tried with:
- .htaccess:
Header set Content-Security-Policy "script-src 'self';"
- html:
<meta http-equiv="Content-Security-Policy" content="script-src 'self'">
- https://ikvasnica.com/blog/how-to-protect-php-application-from-xss-attacks-csp-3-nonce/