{"action":"created","comment":{"url":"https://api.github.com/repos/w3c/webappsec/pulls/comments/31883706","id":31883706,"diff_hunk":"@@ -472,49 +472,32 @@ to enable the rest of this specification's work [[!FETCH]]:\n     Unless stated otherwise, a request's integrity metadata is the empty\n     string.\"\n \n-2.  The following text should be added to [section 2.1.5][fetch-responses]: \"A\n-    [response][fetch-response] has an associated integrity state, which\n-    is one of `indeterminate`, `pending`, `corrupt`, and `intact`. Unless\n-    stated otherwise, it is `indeterminate`.\n+2.  Perform the following step between steps 10 and 11 in the \"[main fetch][]\"\n+    algorithm:\n+\n+    1. If <var>request</var>'s integrity metadata is a non-empty string and\n+       <var>response</var> is not a [network error][]:\n+        1.  Wait for either end-of-file to have been pushed to\n+            <var>response</var>'s body or for <var>response</var> to have a\n+            [termination reason][].\n+        2.  If <var>response</var> does not have a [termination reason][] and\n+            <var>response</var> does not [match][] the [integrity metadata][] of\n+            the <var>request</var>, set <var>response</var> to a\n+            [network error][].\n \n 3.  Perform the following steps before executing both the \"[basic fetch][]\" and\n     \"[CORS fetch with preflight][]\" algorithms:\n \n-    1.  If <var>request</var>'s integrity metadata is the empty string, set\n-        <var>response</var>'s integrity state to `indeterminate`. Otherwise:\n-\n-        1.  Set <var>response</var>'s integrity state to `pending`.\n-        2.  Include a `Cache-Control` header whose value is \"no-transform\".\n-\n-4.  Add the following step before step #1 of the handling of 401 status\n-    codes in the [HTTP fetch][] algorithm:\n-\n-    1.  If <var>request</var>'s integrity state is `pending`, set\n-        <var>response</var>'s integrity state to `corrupt` and return\n-        <var>response</var>.\n-\n-5.  Before firing the [process request end-of-file][] event for any\n-    <var>request</var>:\n-\n-    1.  If the <var>request</var>'s integrity metadata is the empty string, set\n-        the <var>response</var>'s integrity state to `indeterminate` and\n-        skip directly to firing the event.\n-\n-    2.  If <var>response</var> [matches][match] the request's integrity\n-        metadata, set the <var>response</var>'s integrity state to `intact`\n-        and skip directly to firing the event.\n-\n-    3.  Set the <var>response</var>'s integrity state to `corrupt`\n-        and skip directly to firing the event.\n+    1.  If <var>request</var>'s integrity metadata is not the empty string,","path":"specs/subresourceintegrity/spec.markdown","position":50,"original_position":50,"commit_id":"864d6600ef464674ff5dcb637e147dc552867a4d","original_commit_id":"864d6600ef464674ff5dcb637e147dc552867a4d","user":{"login":"fmarier","id":167821,"avatar_url":"https://avatars.githubusercontent.com/u/167821?v=3","gravatar_id":"","url":"https://api.github.com/users/fmarier","html_url":"https://github.com/fmarier","followers_url":"https://api.github.com/users/fmarier/followers","following_url":"https://api.github.com/users/fmarier/following{/other_user}","gists_url":"https://api.github.com/users/fmarier/gists{/gist_id}","starred_url":"https://api.github.com/users/fmarier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fmarier/subscriptions","organizations_url":"https://api.github.com/users/fmarier/orgs","repos_url":"https://api.github.com/users/fmarier/repos","events_url":"https://api.github.com/users/fmarier/events{/privacy}","received_events_url":"https://api.github.com/users/fmarier/received_events","type":"User","site_admin":false},"body":"I would suggest the same phrase as the one you used above: \"is a non-empty string\"\r\n\r\nBecause I consider `integrity=\"\"` and `integrity=\"         \"` to both be empty strings for the purposes of SRI.","created_at":"2015-06-08T01:33:53Z","updated_at":"2015-06-08T01:33:53Z","html_url":"https://github.com/w3c/webappsec/pull/391#discussion_r31883706","pull_request_url":"https://api.github.com/repos/w3c/webappsec/pulls/391","_links":{"self":{"href":"https://api.github.com/repos/w3c/webappsec/pulls/comments/31883706"},"html":{"href":"https://github.com/w3c/webappsec/pull/391#discussion_r31883706"},"pull_request":{"href":"https://api.github.com/repos/w3c/webappsec/pulls/391"}}},"pull_request":{"url":"https://api.github.com/repos/w3c/webappsec/pulls/391","id":36471404,"html_url":"https://github.com/w3c/webappsec/pull/391","diff_url":"https://github.com/w3c/webappsec/pull/391.diff","patch_url":"https://github.com/w3c/webappsec/pull/391.patch","issue_url":"https://api.github.com/repos/w3c/webappsec/issues/391","number":391,"state":"open","locked":false,"title":"SRI: Simplify the element modifications to just set integrity metadata","user":{"login":"metromoxie","id":401207,"avatar_url":"https://avatars.githubusercontent.com/u/401207?v=3","gravatar_id":"","url":"https://api.github.com/users/metromoxie","html_url":"https://github.com/metromoxie","followers_url":"https://api.github.com/users/metromoxie/followers","following_url":"https://api.github.com/users/metromoxie/following{/other_user}","gists_url":"https://api.github.com/users/metromoxie/gists{/gist_id}","starred_url":"https://api.github.com/users/metromoxie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/metromoxie/subscriptions","organizations_url":"https://api.github.com/users/metromoxie/orgs","repos_url":"https://api.github.com/users/metromoxie/repos","events_url":"https://api.github.com/users/metromoxie/events{/privacy}","received_events_url":"https://api.github.com/users/metromoxie/received_events","type":"User","site_admin":false},"body":"This modifies the algorithms to more closely integrate with Fetch, as discussed in #238. This makes several relevant changes:\r\n   1. Adds modifications to main Fetch, after the Mixed Content check, to check for valid integrity. If it fails, it returns a network error.\r\n   2. It removes the \"integrity state\" on the response, as this state doesn't need to be passed around anymore (everything is done in main fetch). This removes a bunch of text from various algorithms.\r\n   3. It simplifies the element modifications to just set `integrity metadata` on the request before Fetch occurs.","created_at":"2015-05-29T03:32:43Z","updated_at":"2015-06-08T01:33:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0627a08a6cd68c1ed35d79fe0593c4360de202cc","assignee":null,"milestone":{"url":"https://api.github.com/repos/w3c/webappsec/milestones/3","html_url":"https://github.com/w3c/webappsec/milestones/SRI-v1-LC","labels_url":"https://api.github.com/repos/w3c/webappsec/milestones/3/labels","id":895505,"number":3,"title":"SRI-v1-LC","description":"Let's conservatively try to include things for the \"minimum viable\" SRI into this milestone. Last Call should happen in January 2015 according to the (draft) charter's milestones.","creator":{"login":"mozfreddyb","id":5418775,"avatar_url":"https://avatars.githubusercontent.com/u/5418775?v=3","gravatar_id":"","url":"https://api.github.com/users/mozfreddyb","html_url":"https://github.com/mozfreddyb","followers_url":"https://api.github.com/users/mozfreddyb/followers","following_url":"https://api.github.com/users/mozfreddyb/following{/other_user}","gists_url":"https://api.github.com/users/mozfreddyb/gists{/gist_id}","starred_url":"https://api.github.com/users/mozfreddyb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozfreddyb/subscriptions","organizations_url":"https://api.github.com/users/mozfreddyb/orgs","repos_url":"https://api.github.com/users/mozfreddyb/repos","events_url":"https://api.github.com/users/mozfreddyb/events{/privacy}","received_events_url":"https://api.github.com/users/mozfreddyb/received_events","type":"User","site_admin":false},"open_issues":7,"closed_issues":71,"state":"open","created_at":"2014-12-08T10:39:40Z","updated_at":"2015-06-07T02:37:02Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/w3c/webappsec/pulls/391/commits","review_comments_url":"https://api.github.com/repos/w3c/webappsec/pulls/391/comments","review_comment_url":"https://api.github.com/repos/w3c/webappsec/pulls/comments{/number}","comments_url":"https://api.github.com/repos/w3c/webappsec/issues/391/comments","statuses_url":"https://api.github.com/repos/w3c/webappsec/statuses/864d6600ef464674ff5dcb637e147dc552867a4d","head":{"label":"metromoxie:fetch-integration","ref":"fetch-integration","sha":"864d6600ef464674ff5dcb637e147dc552867a4d","user":{"login":"metromoxie","id":401207,"avatar_url":"https://avatars.githubusercontent.com/u/401207?v=3","gravatar_id":"","url":"https://api.github.com/users/metromoxie","html_url":"https://github.com/metromoxie","followers_url":"https://api.github.com/users/metromoxie/followers","following_url":"https://api.github.com/users/metromoxie/following{/other_user}","gists_url":"https://api.github.com/users/metromoxie/gists{/gist_id}","starred_url":"https://api.github.com/users/metromoxie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/metromoxie/subscriptions","organizations_url":"https://api.github.com/users/metromoxie/orgs","repos_url":"https://api.github.com/users/metromoxie/repos","events_url":"https://api.github.com/users/metromoxie/events{/privacy}","received_events_url":"https://api.github.com/users/metromoxie/received_events","type":"User","site_admin":false},"repo":{"id":26143612,"name":"webappsec","full_name":"metromoxie/webappsec","owner":{"login":"metromoxie","id":401207,"avatar_url":"https://avatars.githubusercontent.com/u/401207?v=3","gravatar_id":"","url":"https://api.github.com/users/metromoxie","html_url":"https://github.com/metromoxie","followers_url":"https://api.github.com/users/metromoxie/followers","following_url":"https://api.github.com/users/metromoxie/following{/other_user}","gists_url":"https://api.github.com/users/metromoxie/gists{/gist_id}","starred_url":"https://api.github.com/users/metromoxie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/metromoxie/subscriptions","organizations_url":"https://api.github.com/users/metromoxie/orgs","repos_url":"https://api.github.com/users/metromoxie/repos","events_url":"https://api.github.com/users/metromoxie/events{/privacy}","received_events_url":"https://api.github.com/users/metromoxie/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/metromoxie/webappsec","description":"","fork":true,"url":"https://api.github.com/repos/metromoxie/webappsec","forks_url":"https://api.github.com/repos/metromoxie/webappsec/forks","keys_url":"https://api.github.com/repos/metromoxie/webappsec/keys{/key_id}","collaborators_url":"https://api.github.com/repos/metromoxie/webappsec/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/metromoxie/webappsec/teams","hooks_url":"https://api.github.com/repos/metromoxie/webappsec/hooks","issue_events_url":"https://api.github.com/repos/metromoxie/webappsec/issues/events{/number}","events_url":"https://api.github.com/repos/metromoxie/webappsec/events","assignees_url":"https://api.github.com/repos/metromoxie/webappsec/assignees{/user}","branches_url":"https://api.github.com/repos/metromoxie/webappsec/branches{/branch}","tags_url":"https://api.github.com/repos/metromoxie/webappsec/tags","blobs_url":"https://api.github.com/repos/metromoxie/webappsec/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/metromoxie/webappsec/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/metromoxie/webappsec/git/refs{/sha}","trees_url":"https://api.github.com/repos/metromoxie/webappsec/git/trees{/sha}","statuses_url":"https://api.github.com/repos/metromoxie/webappsec/statuses/{sha}","languages_url":"https://api.github.com/repos/metromoxie/webappsec/languages","stargazers_url":"https://api.github.com/repos/metromoxie/webappsec/stargazers","contributors_url":"https://api.github.com/repos/metromoxie/webappsec/contributors","subscribers_url":"https://api.github.com/repos/metromoxie/webappsec/subscribers","subscription_url":"https://api.github.com/repos/metromoxie/webappsec/subscription","commits_url":"https://api.github.com/repos/metromoxie/webappsec/commits{/sha}","git_commits_url":"https://api.github.com/repos/metromoxie/webappsec/git/commits{/sha}","comments_url":"https://api.github.com/repos/metromoxie/webappsec/comments{/number}","issue_comment_url":"https://api.github.com/repos/metromoxie/webappsec/issues/comments{/number}","contents_url":"https://api.github.com/repos/metromoxie/webappsec/contents/{+path}","compare_url":"https://api.github.com/repos/metromoxie/webappsec/compare/{base}...{head}","merges_url":"https://api.github.com/repos/metromoxie/webappsec/merges","archive_url":"https://api.github.com/repos/metromoxie/webappsec/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/metromoxie/webappsec/downloads","issues_url":"https://api.github.com/repos/metromoxie/webappsec/issues{/number}","pulls_url":"https://api.github.com/repos/metromoxie/webappsec/pulls{/number}","milestones_url":"https://api.github.com/repos/metromoxie/webappsec/milestones{/number}","notifications_url":"https://api.github.com/repos/metromoxie/webappsec/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/metromoxie/webappsec/labels{/name}","releases_url":"https://api.github.com/repos/metromoxie/webappsec/releases{/id}","created_at":"2014-11-03T23:21:54Z","updated_at":"2015-04-18T00:34:34Z","pushed_at":"2015-06-06T17:18:53Z","git_url":"git://github.com/metromoxie/webappsec.git","ssh_url":"git@github.com:metromoxie/webappsec.git","clone_url":"https://github.com/metromoxie/webappsec.git","svn_url":"https://github.com/metromoxie/webappsec","homepage":null,"size":7534,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"w3c:master","ref":"master","sha":"ef378bbc753f1f5ad9c342250ca30e51958f49e5","user":{"login":"w3c","id":379216,"avatar_url":"https://avatars.githubusercontent.com/u/379216?v=3","gravatar_id":"","url":"https://api.github.com/users/w3c","html_url":"https://github.com/w3c","followers_url":"https://api.github.com/users/w3c/followers","following_url":"https://api.github.com/users/w3c/following{/other_user}","gists_url":"https://api.github.com/users/w3c/gists{/gist_id}","starred_url":"https://api.github.com/users/w3c/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/w3c/subscriptions","organizations_url":"https://api.github.com/users/w3c/orgs","repos_url":"https://api.github.com/users/w3c/repos","events_url":"https://api.github.com/users/w3c/events{/privacy}","received_events_url":"https://api.github.com/users/w3c/received_events","type":"Organization","site_admin":false},"repo":{"id":15536087,"name":"webappsec","full_name":"w3c/webappsec","owner":{"login":"w3c","id":379216,"avatar_url":"https://avatars.githubusercontent.com/u/379216?v=3","gravatar_id":"","url":"https://api.github.com/users/w3c","html_url":"https://github.com/w3c","followers_url":"https://api.github.com/users/w3c/followers","following_url":"https://api.github.com/users/w3c/following{/other_user}","gists_url":"https://api.github.com/users/w3c/gists{/gist_id}","starred_url":"https://api.github.com/users/w3c/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/w3c/subscriptions","organizations_url":"https://api.github.com/users/w3c/orgs","repos_url":"https://api.github.com/users/w3c/repos","events_url":"https://api.github.com/users/w3c/events{/privacy}","received_events_url":"https://api.github.com/users/w3c/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/w3c/webappsec","description":"","fork":false,"url":"https://api.github.com/repos/w3c/webappsec","forks_url":"https://api.github.com/repos/w3c/webappsec/forks","keys_url":"https://api.github.com/repos/w3c/webappsec/keys{/key_id}","collaborators_url":"https://api.github.com/repos/w3c/webappsec/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/w3c/webappsec/teams","hooks_url":"https://api.github.com/repos/w3c/webappsec/hooks","issue_events_url":"https://api.github.com/repos/w3c/webappsec/issues/events{/number}","events_url":"https://api.github.com/repos/w3c/webappsec/events","assignees_url":"https://api.github.com/repos/w3c/webappsec/assignees{/user}","branches_url":"https://api.github.com/repos/w3c/webappsec/branches{/branch}","tags_url":"https://api.github.com/repos/w3c/webappsec/tags","blobs_url":"https://api.github.com/repos/w3c/webappsec/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/w3c/webappsec/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/w3c/webappsec/git/refs{/sha}","trees_url":"https://api.github.com/repos/w3c/webappsec/git/trees{/sha}","statuses_url":"https://api.github.com/repos/w3c/webappsec/statuses/{sha}","languages_url":"https://api.github.com/repos/w3c/webappsec/languages","stargazers_url":"https://api.github.com/repos/w3c/webappsec/stargazers","contributors_url":"https://api.github.com/repos/w3c/webappsec/contributors","subscribers_url":"https://api.github.com/repos/w3c/webappsec/subscribers","subscription_url":"https://api.github.com/repos/w3c/webappsec/subscription","commits_url":"https://api.github.com/repos/w3c/webappsec/commits{/sha}","git_commits_url":"https://api.github.com/repos/w3c/webappsec/git/commits{/sha}","comments_url":"https://api.github.com/repos/w3c/webappsec/comments{/number}","issue_comment_url":"https://api.github.com/repos/w3c/webappsec/issues/comments{/number}","contents_url":"https://api.github.com/repos/w3c/webappsec/contents/{+path}","compare_url":"https://api.github.com/repos/w3c/webappsec/compare/{base}...{head}","merges_url":"https://api.github.com/repos/w3c/webappsec/merges","archive_url":"https://api.github.com/repos/w3c/webappsec/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/w3c/webappsec/downloads","issues_url":"https://api.github.com/repos/w3c/webappsec/issues{/number}","pulls_url":"https://api.github.com/repos/w3c/webappsec/pulls{/number}","milestones_url":"https://api.github.com/repos/w3c/webappsec/milestones{/number}","notifications_url":"https://api.github.com/repos/w3c/webappsec/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/w3c/webappsec/labels{/name}","releases_url":"https://api.github.com/repos/w3c/webappsec/releases{/id}","created_at":"2013-12-30T20:39:16Z","updated_at":"2015-06-04T00:37:13Z","pushed_at":"2015-06-07T03:16:26Z","git_url":"git://github.com/w3c/webappsec.git","ssh_url":"git@github.com:w3c/webappsec.git","clone_url":"https://github.com/w3c/webappsec.git","svn_url":"https://github.com/w3c/webappsec","homepage":null,"size":11774,"stargazers_count":113,"watchers_count":113,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":49,"mirror_url":null,"open_issues_count":81,"forks":49,"open_issues":81,"watchers":113,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/w3c/webappsec/pulls/391"},"html":{"href":"https://github.com/w3c/webappsec/pull/391"},"issue":{"href":"https://api.github.com/repos/w3c/webappsec/issues/391"},"comments":{"href":"https://api.github.com/repos/w3c/webappsec/issues/391/comments"},"review_comments":{"href":"https://api.github.com/repos/w3c/webappsec/pulls/391/comments"},"review_comment":{"href":"https://api.github.com/repos/w3c/webappsec/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/w3c/webappsec/pulls/391/commits"},"statuses":{"href":"https://api.github.com/repos/w3c/webappsec/statuses/864d6600ef464674ff5dcb637e147dc552867a4d"}}}}