@@ -372,16 +372,18 @@ valid hash expressions whose hash functions are understood by
372
372
the user agent.
373
373
374
374
1 . Let <var >result</var > be the empty set.
375
- 2 . For each <var >token</var > returned by [ splitting <var >metadata</var > on
375
+ 2 . Let <var >empty</var > be equal to ` true ` .
376
+ 3 . For each <var >token</var > returned by [ splitting <var >metadata</var > on
376
377
spaces] [ split-on-spaces ] :
377
- 1 . If <var >token</var > is not a valid metadata, skip the remaining
378
+ 1 . Set <var >empty</var > to ` false ` .
379
+ 2 . If <var >token</var > is not a valid metadata, skip the remaining
378
380
steps, and proceed to the next token.
379
- 2 . Parse <var >token</var > per the grammar in [ integrity metadata] [ ]
380
- 3 . Let <var >algorithm</var > be the <var >alg</var > component of
381
+ 3 . Parse <var >token</var > per the grammar in [ integrity metadata] [ ]
382
+ 4 . Let <var >algorithm</var > be the <var >alg</var > component of
381
383
<var >token</var >.
382
- 4 . If <var >algorithm</var > is a hash function recognized by the user
384
+ 5 . If <var >algorithm</var > is a hash function recognized by the user
383
385
agent, add the parsed <var >token</var > to <var >result</var >.
384
- 3 . Return ` no metadata ` if <var >result </var > is empty , otherwise return
386
+ 4 . Return ` no metadata ` if <var >empty </var > is ` true ` , otherwise return
385
387
<var >result</var >.
386
388
387
389
[ split-on-spaces ] : http://www.w3.org/TR/html5/infrastructure.html#split-a-string-on-spaces
@@ -420,9 +422,10 @@ the user agent.
420
422
2 . If <var >parsedMetadata</var > is ` no metadata ` , return ` true ` .
421
423
3 . If [ <var >response</var > is not eligible for integrity
422
424
validation] [ eligible ] , return ` false ` .
423
- 4 . Let <var >metadata</var > be the result of [ getting the strongest
425
+ 4 . If <var >parsedMetadata</var > is the empty set, return ` true ` .
426
+ 5 . Let <var >metadata</var > be the result of [ getting the strongest
424
427
metadata from <var >parsedMetadata</var >] [ get-the-strongest ] .
425
- 5 . For each <var >item</var > in <var >metadata</var >:
428
+ 6 . For each <var >item</var > in <var >metadata</var >:
426
429
1 . Let <var >algorithm</var > be the <var >alg</var > component of
427
430
<var >item</var >.
428
431
2 . Let <var >expectedValue</var > be the <var >val</var > component of
@@ -431,7 +434,7 @@ the user agent.
431
434
<var >algorithm</var > to <var >response</var >] [ apply-algorithm ] .
432
435
4 . If <var >actualValue</var > is a case-sensitive match for
433
436
<var >expectedValue</var >, return ` true ` .
434
- 6 . Return ` false ` .
437
+ 7 . Return ` false ` .
435
438
436
439
This algorithm allows the user agent to accept multiple, valid strong hash
437
440
functions. For example, a developer might write a ` script ` element such as:
0 commit comments