Skip to content

Commit 205cac6

Browse files
authored
Simplify hash reporting algorithm (#723)
1 parent f5d4027 commit 205cac6

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

index.bs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1116,11 +1116,8 @@ spec:SRI; urlPrefix: https://w3c.github.io/webappsec-subresource-integrity
11161116
1. If |algorithm| is the empty [=string=], return.
11171117
1. Let |hash| be the empty [=string=].
11181118
1. If |response| is [=CORS-same-origin=], then:
1119-
1. Let |hash list| be a [=list=] of [=strings=], initially empty.
1120-
1. [=list/Append=] |algorithm| to |hash list|.
1121-
1. [=list/Append=] the result of [=applying algorithm to bytes=] on |response|'s
1122-
[=response/body=] and |algorithm| to |hash list|.
1123-
1. Let |hash| be the result of [=concatenating=] |hash list| with U+002D (-).
1119+
1. Let |h| be the result of [=applying algorithm to bytes=] on |response|'s [=response/body=] and |algorithm|.
1120+
1. Let |hash| be the [=concatenation=] of |algorithm|, U+2D (-), and |h|.
11241121
1. Let |global| be the |request|'s [=request/client=]'s [=/global object=].
11251122
1. If |global| is not a {{Window}}, return.
11261123
1. Let |stripped document URL| to be the result of executing [[#strip-url-for-use-in-reports]]
@@ -1689,7 +1686,7 @@ Content-Type: application/reports+json
16891686
"body": {
16901687
"document_url": "https://example.com/",
16911688
"subresource_url": "https://example.com/main.js",
1692-
"hash": "sha256-badbeef",
1689+
"hash": "sha256-85738f8f9a7f1b04b5329c590ebcb9e425925c6d0984089c43a022de4f19c281",
16931690
"type": "subresource",
16941691
"destination": "script"
16951692
}

0 commit comments

Comments
 (0)