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

Resource hint: check directives explicitly #637

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 24 additions & 4 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -3765,10 +3765,30 @@ this algorithm returns normally if compilation is allowed, and throws a

3. <a for=set>For each</a> |directive| of |policy|:

1. Let |result| be the result of executing |directive|'s
<a for="directive">pre-request check</a> on |request| and |policy|.

2. If |result| is "`Allowed`", then return "`Does Not Violate`".
1. If |directive|'s <a for="directive">name</a> is not one of the following:
* `child-src`
* `connect-src`
* `font-src`
* `frame-src`
* `img-src`
* `manifest-src`
* `media-src`
* `object-src`
* `script-src`
* `script-src-elem`
* `style-src`
* `style-src-elem`
* `worker-src`

then continue.

1. Assert: |directive|'s <a for="directive">value</a> is a <a>source list</a>.
Copy link
Member

Choose a reason for hiding this comment

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

I guess this is not always true. For script-src there can be nonces and hashes and keywords.


1. Let |result| be the result of executing [[#match-request-to-source-list]] on
|request|, |directive|'s <a for="directive">value</a>, and
|policy|.

1. If |result| is "`Allowed`", then return "`Does Not Violate`".

4. Return |defaultDirective|.

Expand Down
Loading