Skip to content

Commit cf891fb

Browse files
authored
Resource hint: check directives explicitly (#637)
Apparently the previous wording was a no-op. Instead of calling the pre-request check, checking the resource list for the directives that have that as a value. Closes #633
1 parent 535ad80 commit cf891fb

File tree

1 file changed

+24
-4
lines changed

1 file changed

+24
-4
lines changed

index.bs

+24-4
Original file line numberDiff line numberDiff line change
@@ -3870,10 +3870,30 @@ Content-Type: application/reports+json
38703870

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

3873-
1. Let |result| be the result of executing |directive|'s
3874-
<a for="directive">pre-request check</a> on |request| and |policy|.
3875-
3876-
2. If |result| is "`Allowed`", then return "`Does Not Violate`".
3873+
1. If |directive|'s <a for="directive">name</a> is not one of the following:
3874+
* `child-src`
3875+
* `connect-src`
3876+
* `font-src`
3877+
* `frame-src`
3878+
* `img-src`
3879+
* `manifest-src`
3880+
* `media-src`
3881+
* `object-src`
3882+
* `script-src`
3883+
* `script-src-elem`
3884+
* `style-src`
3885+
* `style-src-elem`
3886+
* `worker-src`
3887+
3888+
then continue.
3889+
3890+
1. Assert: |directive|'s <a for="directive">value</a> is a <a>source list</a>.
3891+
3892+
1. Let |result| be the result of executing [[#match-request-to-source-list]] on
3893+
|request|, |directive|'s <a for="directive">value</a>, and
3894+
|policy|.
3895+
3896+
1. If |result| is "`Allowed`", then return "`Does Not Violate`".
38773897

38783898
4. Return |defaultDirective|.
38793899

0 commit comments

Comments
 (0)