{"action":"created","comment":{"url":"https://api.github.com/repos/w3c/webappsec-csp/pulls/comments/86551423","pull_request_review_id":7200043,"id":86551423,"diff_hunk":"@@ -3493,6 +3433,103 @@ <h5 id=\"match-schemes\" algorithm>\n \n   2.  Return \"`Does Not Match`\".\n \n+  <h5 id=\"match-hosts\" algorithm>\n+    Does |host-part| match another |host-part|?\n+  </h5>\n+\n+  Given two <a>ASCII strings</a> A and B, this algorithm returns \"`Matches`\" if A \n+  matches B, and returns \"`Does Not Match`\" otherwise.\n+\n+  Note: This algorithm is not transitive. That is, A matching B does not mean \n+  that B will match A.\n+\n+  1.  If the first character of A is an U+002A ASTERISK character (`*`):\n+\n+      1.  Let remaining be the result of removing the leading \"*\" from A.\n+\n+      2.  If remaining (including the leading U+002E FULL STOP character (.)) is an \n+          ASCII case-insensitive match for the rightmost characters of B, then \n+          return \"`Matches`\".\n+\n+      3.  Return \"`Does Not Match`\".      \n+\n+  2.  If A is an ASCII case-insensitive match for B, return \"`Matches`\".\n+\n+  3.  If A matches the <a grammar>IPv4address</a> rule from [[!RFC3986]], and is\n+      \"`127.0.0.1`\"; or if A is not an <a>IPv6 address</a>, return \"`Matches`\".\n+\n+      Note: A future version of this specification may allow literal IPv6\n+      and IPv4 addresses, depending on usage and demand. Given the weak\n+      security properties of IP addresses in relation to named hosts,\n+      however, authors are encouraged to prefer the latter whenever\n+      possible.\n+\n+  4.  Return \"`Does Not Match`\".\n+\n+  <h5 id=\"match-ports\" algorithm>\n+    Does |port-part| match another |port-part|?\n+  </h5>\n+\n+  Given three <a>ASCII strings</a> A, B and Scheme-B, this algorithm returns \n+  \"`Matches`\" if A matches B, and returns \"`Does Not Match`\" otherwise.\n+\n+  Note: This algorithm is not transitive. That is, A matching B does not mean \n+  that B will match A.\n+\n+  1.  If A is empty:\n+\n+      1.  If B is the <a>default port</a> for Scheme-B, return \"`Matches`\".\n+          \n+      2.  Return \"`Does Not Match`\".\n+\n+  2.  If A is equal to \":*\", return \"`Matches`\".","path":"index.src.html","position":143,"original_position":143,"commit_id":"548ca99d6a35dae99442493772fc3d0cbc1e7150","original_commit_id":"548ca99d6a35dae99442493772fc3d0cbc1e7150","user":{"login":"mikewest","id":1497,"avatar_url":"https://avatars.githubusercontent.com/u/1497?v=3","gravatar_id":"","url":"https://api.github.com/users/mikewest","html_url":"https://github.com/mikewest","followers_url":"https://api.github.com/users/mikewest/followers","following_url":"https://api.github.com/users/mikewest/following{/other_user}","gists_url":"https://api.github.com/users/mikewest/gists{/gist_id}","starred_url":"https://api.github.com/users/mikewest/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikewest/subscriptions","organizations_url":"https://api.github.com/users/mikewest/orgs","repos_url":"https://api.github.com/users/mikewest/repos","events_url":"https://api.github.com/users/mikewest/events{/privacy}","received_events_url":"https://api.github.com/users/mikewest/received_events","type":"User","site_admin":false},"body":"Let's change the `host-source` grammar to exclude the `:` from `port-source`. That is, something like:\r\n\r\n\r\n```\r\nhost-source = [ scheme-part \"://\" ] host-part [ \":\" port-part ] [ path-part ]\r\n...\r\nport-part = 1*DIGIT / \"*\"\r\n```\r\n\r\nOtherwise, the matching in 3 is not going to work.","created_at":"2016-11-04T14:05:58Z","updated_at":"2016-11-04T14:28:39Z","html_url":"https://github.com/w3c/webappsec-csp/pull/137#discussion_r86551423","pull_request_url":"https://api.github.com/repos/w3c/webappsec-csp/pulls/137","_links":{"self":{"href":"https://api.github.com/repos/w3c/webappsec-csp/pulls/comments/86551423"},"html":{"href":"https://github.com/w3c/webappsec-csp/pull/137#discussion_r86551423"},"pull_request":{"href":"https://api.github.com/repos/w3c/webappsec-csp/pulls/137"}}},"pull_request":{"url":"https://api.github.com/repos/w3c/webappsec-csp/pulls/137","id":92333297,"html_url":"https://github.com/w3c/webappsec-csp/pull/137","diff_url":"https://github.com/w3c/webappsec-csp/pull/137.diff","patch_url":"https://github.com/w3c/webappsec-csp/pull/137.patch","issue_url":"https://api.github.com/repos/w3c/webappsec-csp/issues/137","number":137,"state":"open","locked":false,"title":"Adding match-hosts, match-ports and match-paths.","user":{"login":"Sun77789","id":5797085,"avatar_url":"https://avatars.githubusercontent.com/u/5797085?v=3","gravatar_id":"","url":"https://api.github.com/users/Sun77789","html_url":"https://github.com/Sun77789","followers_url":"https://api.github.com/users/Sun77789/followers","following_url":"https://api.github.com/users/Sun77789/following{/other_user}","gists_url":"https://api.github.com/users/Sun77789/gists{/gist_id}","starred_url":"https://api.github.com/users/Sun77789/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sun77789/subscriptions","organizations_url":"https://api.github.com/users/Sun77789/orgs","repos_url":"https://api.github.com/users/Sun77789/repos","events_url":"https://api.github.com/users/Sun77789/events{/privacy}","received_events_url":"https://api.github.com/users/Sun77789/received_events","type":"User","site_admin":false},"body":"@mikewest ","created_at":"2016-11-04T12:44:18Z","updated_at":"2016-11-04T14:28:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0953dd2f9f2db49ac188951db75a2ec315d5d361","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/w3c/webappsec-csp/pulls/137/commits","review_comments_url":"https://api.github.com/repos/w3c/webappsec-csp/pulls/137/comments","review_comment_url":"https://api.github.com/repos/w3c/webappsec-csp/pulls/comments{/number}","comments_url":"https://api.github.com/repos/w3c/webappsec-csp/issues/137/comments","statuses_url":"https://api.github.com/repos/w3c/webappsec-csp/statuses/548ca99d6a35dae99442493772fc3d0cbc1e7150","head":{"label":"Sun77789:csp3part1","ref":"csp3part1","sha":"548ca99d6a35dae99442493772fc3d0cbc1e7150","user":{"login":"Sun77789","id":5797085,"avatar_url":"https://avatars.githubusercontent.com/u/5797085?v=3","gravatar_id":"","url":"https://api.github.com/users/Sun77789","html_url":"https://github.com/Sun77789","followers_url":"https://api.github.com/users/Sun77789/followers","following_url":"https://api.github.com/users/Sun77789/following{/other_user}","gists_url":"https://api.github.com/users/Sun77789/gists{/gist_id}","starred_url":"https://api.github.com/users/Sun77789/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sun77789/subscriptions","organizations_url":"https://api.github.com/users/Sun77789/orgs","repos_url":"https://api.github.com/users/Sun77789/repos","events_url":"https://api.github.com/users/Sun77789/events{/privacy}","received_events_url":"https://api.github.com/users/Sun77789/received_events","type":"User","site_admin":false},"repo":{"id":72195104,"name":"webappsec-csp","full_name":"Sun77789/webappsec-csp","owner":{"login":"Sun77789","id":5797085,"avatar_url":"https://avatars.githubusercontent.com/u/5797085?v=3","gravatar_id":"","url":"https://api.github.com/users/Sun77789","html_url":"https://github.com/Sun77789","followers_url":"https://api.github.com/users/Sun77789/followers","following_url":"https://api.github.com/users/Sun77789/following{/other_user}","gists_url":"https://api.github.com/users/Sun77789/gists{/gist_id}","starred_url":"https://api.github.com/users/Sun77789/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sun77789/subscriptions","organizations_url":"https://api.github.com/users/Sun77789/orgs","repos_url":"https://api.github.com/users/Sun77789/repos","events_url":"https://api.github.com/users/Sun77789/events{/privacy}","received_events_url":"https://api.github.com/users/Sun77789/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Sun77789/webappsec-csp","description":"WebAppSec Content Security Policy","fork":true,"url":"https://api.github.com/repos/Sun77789/webappsec-csp","forks_url":"https://api.github.com/repos/Sun77789/webappsec-csp/forks","keys_url":"https://api.github.com/repos/Sun77789/webappsec-csp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Sun77789/webappsec-csp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Sun77789/webappsec-csp/teams","hooks_url":"https://api.github.com/repos/Sun77789/webappsec-csp/hooks","issue_events_url":"https://api.github.com/repos/Sun77789/webappsec-csp/issues/events{/number}","events_url":"https://api.github.com/repos/Sun77789/webappsec-csp/events","assignees_url":"https://api.github.com/repos/Sun77789/webappsec-csp/assignees{/user}","branches_url":"https://api.github.com/repos/Sun77789/webappsec-csp/branches{/branch}","tags_url":"https://api.github.com/repos/Sun77789/webappsec-csp/tags","blobs_url":"https://api.github.com/repos/Sun77789/webappsec-csp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Sun77789/webappsec-csp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Sun77789/webappsec-csp/git/refs{/sha}","trees_url":"https://api.github.com/repos/Sun77789/webappsec-csp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Sun77789/webappsec-csp/statuses/{sha}","languages_url":"https://api.github.com/repos/Sun77789/webappsec-csp/languages","stargazers_url":"https://api.github.com/repos/Sun77789/webappsec-csp/stargazers","contributors_url":"https://api.github.com/repos/Sun77789/webappsec-csp/contributors","subscribers_url":"https://api.github.com/repos/Sun77789/webappsec-csp/subscribers","subscription_url":"https://api.github.com/repos/Sun77789/webappsec-csp/subscription","commits_url":"https://api.github.com/repos/Sun77789/webappsec-csp/commits{/sha}","git_commits_url":"https://api.github.com/repos/Sun77789/webappsec-csp/git/commits{/sha}","comments_url":"https://api.github.com/repos/Sun77789/webappsec-csp/comments{/number}","issue_comment_url":"https://api.github.com/repos/Sun77789/webappsec-csp/issues/comments{/number}","contents_url":"https://api.github.com/repos/Sun77789/webappsec-csp/contents/{+path}","compare_url":"https://api.github.com/repos/Sun77789/webappsec-csp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Sun77789/webappsec-csp/merges","archive_url":"https://api.github.com/repos/Sun77789/webappsec-csp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Sun77789/webappsec-csp/downloads","issues_url":"https://api.github.com/repos/Sun77789/webappsec-csp/issues{/number}","pulls_url":"https://api.github.com/repos/Sun77789/webappsec-csp/pulls{/number}","milestones_url":"https://api.github.com/repos/Sun77789/webappsec-csp/milestones{/number}","notifications_url":"https://api.github.com/repos/Sun77789/webappsec-csp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Sun77789/webappsec-csp/labels{/name}","releases_url":"https://api.github.com/repos/Sun77789/webappsec-csp/releases{/id}","deployments_url":"https://api.github.com/repos/Sun77789/webappsec-csp/deployments","created_at":"2016-10-28T09:43:48Z","updated_at":"2016-10-28T09:43:49Z","pushed_at":"2016-11-04T13:24:13Z","git_url":"git://github.com/Sun77789/webappsec-csp.git","ssh_url":"git@github.com:Sun77789/webappsec-csp.git","clone_url":"https://github.com/Sun77789/webappsec-csp.git","svn_url":"https://github.com/Sun77789/webappsec-csp","homepage":"https://w3c.github.io/webappsec-csp/","size":2765,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"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":"e3463b0c3d57a15ef5aa984ebd0260cb7b811d25","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":43490815,"name":"webappsec-csp","full_name":"w3c/webappsec-csp","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-csp","description":"WebAppSec Content Security Policy","fork":false,"url":"https://api.github.com/repos/w3c/webappsec-csp","forks_url":"https://api.github.com/repos/w3c/webappsec-csp/forks","keys_url":"https://api.github.com/repos/w3c/webappsec-csp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/w3c/webappsec-csp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/w3c/webappsec-csp/teams","hooks_url":"https://api.github.com/repos/w3c/webappsec-csp/hooks","issue_events_url":"https://api.github.com/repos/w3c/webappsec-csp/issues/events{/number}","events_url":"https://api.github.com/repos/w3c/webappsec-csp/events","assignees_url":"https://api.github.com/repos/w3c/webappsec-csp/assignees{/user}","branches_url":"https://api.github.com/repos/w3c/webappsec-csp/branches{/branch}","tags_url":"https://api.github.com/repos/w3c/webappsec-csp/tags","blobs_url":"https://api.github.com/repos/w3c/webappsec-csp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/w3c/webappsec-csp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/w3c/webappsec-csp/git/refs{/sha}","trees_url":"https://api.github.com/repos/w3c/webappsec-csp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/w3c/webappsec-csp/statuses/{sha}","languages_url":"https://api.github.com/repos/w3c/webappsec-csp/languages","stargazers_url":"https://api.github.com/repos/w3c/webappsec-csp/stargazers","contributors_url":"https://api.github.com/repos/w3c/webappsec-csp/contributors","subscribers_url":"https://api.github.com/repos/w3c/webappsec-csp/subscribers","subscription_url":"https://api.github.com/repos/w3c/webappsec-csp/subscription","commits_url":"https://api.github.com/repos/w3c/webappsec-csp/commits{/sha}","git_commits_url":"https://api.github.com/repos/w3c/webappsec-csp/git/commits{/sha}","comments_url":"https://api.github.com/repos/w3c/webappsec-csp/comments{/number}","issue_comment_url":"https://api.github.com/repos/w3c/webappsec-csp/issues/comments{/number}","contents_url":"https://api.github.com/repos/w3c/webappsec-csp/contents/{+path}","compare_url":"https://api.github.com/repos/w3c/webappsec-csp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/w3c/webappsec-csp/merges","archive_url":"https://api.github.com/repos/w3c/webappsec-csp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/w3c/webappsec-csp/downloads","issues_url":"https://api.github.com/repos/w3c/webappsec-csp/issues{/number}","pulls_url":"https://api.github.com/repos/w3c/webappsec-csp/pulls{/number}","milestones_url":"https://api.github.com/repos/w3c/webappsec-csp/milestones{/number}","notifications_url":"https://api.github.com/repos/w3c/webappsec-csp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/w3c/webappsec-csp/labels{/name}","releases_url":"https://api.github.com/repos/w3c/webappsec-csp/releases{/id}","deployments_url":"https://api.github.com/repos/w3c/webappsec-csp/deployments","created_at":"2015-10-01T10:33:26Z","updated_at":"2016-11-04T12:09:41Z","pushed_at":"2016-11-04T13:24:13Z","git_url":"git://github.com/w3c/webappsec-csp.git","ssh_url":"git@github.com:w3c/webappsec-csp.git","clone_url":"https://github.com/w3c/webappsec-csp.git","svn_url":"https://github.com/w3c/webappsec-csp","homepage":"https://w3c.github.io/webappsec-csp/","size":2969,"stargazers_count":21,"watchers_count":21,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":20,"mirror_url":null,"open_issues_count":69,"forks":20,"open_issues":69,"watchers":21,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/w3c/webappsec-csp/pulls/137"},"html":{"href":"https://github.com/w3c/webappsec-csp/pull/137"},"issue":{"href":"https://api.github.com/repos/w3c/webappsec-csp/issues/137"},"comments":{"href":"https://api.github.com/repos/w3c/webappsec-csp/issues/137/comments"},"review_comments":{"href":"https://api.github.com/repos/w3c/webappsec-csp/pulls/137/comments"},"review_comment":{"href":"https://api.github.com/repos/w3c/webappsec-csp/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/w3c/webappsec-csp/pulls/137/commits"},"statuses":{"href":"https://api.github.com/repos/w3c/webappsec-csp/statuses/548ca99d6a35dae99442493772fc3d0cbc1e7150"}}}}
{"actor":{"display_login":"mikewest"}}