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

Disallow empty policy names on creation. #560

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

koto
Copy link
Member

@koto koto commented Oct 31, 2024

Fixes #466.


Preview | Diff

@@ -954,6 +954,7 @@ To create a {{TrustedTypePolicy}}, given a {{TrustedTypePolicyFactory}} (|factor
a string (|policyName|), {{TrustedTypePolicyOptions}} dictionary (|options|), and a
[=realm/global object=] (|global|) run these steps:

1. If |policyName| is the empty string, throw a TypeError and abort further steps.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please link to the more general spec issue with a note like:

<p class=note> Disallowing the empty string since CSP directives can't refer to that. A limited set of other directives can't be referred to either; those, web-developers will have to rename if they need to be referenced; see https://github.com/w3c/trusted-types/issues/504#issue-2247635542.</p>

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