Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

require-trusted-types-for is broken #75

Open
dragonbear-os opened this issue Sep 9, 2022 · 0 comments
Open

require-trusted-types-for is broken #75

dragonbear-os opened this issue Sep 9, 2022 · 0 comments

Comments

@dragonbear-os
Copy link

The following code:

csp({
  directives: {
    "require-trusted-types-for": ["script"],
  }
})

results in this header:

content-security-policy: script-src 'self' 'unsafe-eval' 'unsafe-inline' https:;style-src 'self' 'unsafe-inline';font-src 'self' data:;default-src 'self';object-src 'none';base-uri 'none';require-trusted-types-for script

which is invalid and results in:

Invalid expression in 'require-trusted-types-for' Content Security Policy directive: script. Did you mean 'script'?

The type for require-trusted-types-for is Array<"script"> so that is the only thing I can pass there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant