{"action":"created","comment":{"url":"https://api.github.com/repos/yegor256/takes/pulls/comments/31491354","id":31491354,"diff_hunk":"@@ -0,0 +1,118 @@\n+/**\n+ * The MIT License (MIT)\n+ *\n+ * Copyright (c) 2015 Yegor Bugayenko\n+ *\n+ * Permission is hereby granted, free of charge, to any person obtaining a copy\n+ * of this software and associated documentation files (the \"Software\"), to deal\n+ * in the Software without restriction, including without limitation the rights\n+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n+ * copies of the Software, and to permit persons to whom the Software is\n+ * furnished to do so, subject to the following conditions:\n+ *\n+ * The above copyright notice and this permission notice shall be included\n+ * in all copies or substantial portions of the Software.\n+ *\n+ * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE\n+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n+ * SOFTWARE.\n+ */\n+package org.takes.tk;\n+\n+import java.io.IOException;\n+import java.net.HttpURLConnection;\n+import java.util.HashSet;\n+import java.util.Set;\n+import lombok.EqualsAndHashCode;\n+import org.takes.Request;\n+import org.takes.Response;\n+import org.takes.Take;\n+import org.takes.rs.RsWithHeaders;\n+import org.takes.rs.RsWithStatus;\n+\n+/**\n+ * CORS take.\n+ *\n+ * <p>This take checks if the request (Origin) is allowed to perform\n+ * the desired action against the list of the given domains.</p>\n+ *\n+ * <p>The specification of CORS can be found on the W3C web site on the\n+ * following <a href=\"http://www.w3.org/TR/cors/\">link</a> or even on the <a\n+ * href=\"https://tools.ietf.org/html/rfc6454\">RFC-6454</a> specification.\n+ *\n+ * @author Endrigo Antonini (teamed@endrigo.com.br)\n+ * @version $Id$\n+ * @since 0.20\n+ */\n+@EqualsAndHashCode(of = { \"origin\" , \"alloweddomains\" })\n+public class TkCORS implements Take {","path":"src/main/java/org/takes/tk/TkCORS.java","position":52,"original_position":52,"commit_id":"7478971d0b1d956604d1684edb103886e08b3f92","original_commit_id":"7478971d0b1d956604d1684edb103886e08b3f92","user":{"login":"antonini","id":209396,"avatar_url":"https://avatars.githubusercontent.com/u/209396?v=3","gravatar_id":"","url":"https://api.github.com/users/antonini","html_url":"https://github.com/antonini","followers_url":"https://api.github.com/users/antonini/followers","following_url":"https://api.github.com/users/antonini/following{/other_user}","gists_url":"https://api.github.com/users/antonini/gists{/gist_id}","starred_url":"https://api.github.com/users/antonini/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/antonini/subscriptions","organizations_url":"https://api.github.com/users/antonini/orgs","repos_url":"https://api.github.com/users/antonini/repos","events_url":"https://api.github.com/users/antonini/events{/privacy}","received_events_url":"https://api.github.com/users/antonini/received_events","type":"User","site_admin":false},"body":"@carlosmiranda Fixed.","created_at":"2015-06-02T03:48:54Z","updated_at":"2015-06-02T03:48:54Z","html_url":"https://github.com/yegor256/takes/pull/326#discussion_r31491354","pull_request_url":"https://api.github.com/repos/yegor256/takes/pulls/326","_links":{"self":{"href":"https://api.github.com/repos/yegor256/takes/pulls/comments/31491354"},"html":{"href":"https://github.com/yegor256/takes/pull/326#discussion_r31491354"},"pull_request":{"href":"https://api.github.com/repos/yegor256/takes/pulls/326"}}},"pull_request":{"url":"https://api.github.com/repos/yegor256/takes/pulls/326","id":36597707,"html_url":"https://github.com/yegor256/takes/pull/326","diff_url":"https://github.com/yegor256/takes/pull/326.diff","patch_url":"https://github.com/yegor256/takes/pull/326.patch","issue_url":"https://api.github.com/repos/yegor256/takes/issues/326","number":326,"state":"open","locked":false,"title":"Implemented a take action to check CORS parameters. Issue #258","user":{"login":"antonini","id":209396,"avatar_url":"https://avatars.githubusercontent.com/u/209396?v=3","gravatar_id":"","url":"https://api.github.com/users/antonini","html_url":"https://github.com/antonini","followers_url":"https://api.github.com/users/antonini/followers","following_url":"https://api.github.com/users/antonini/following{/other_user}","gists_url":"https://api.github.com/users/antonini/gists{/gist_id}","starred_url":"https://api.github.com/users/antonini/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/antonini/subscriptions","organizations_url":"https://api.github.com/users/antonini/orgs","repos_url":"https://api.github.com/users/antonini/repos","events_url":"https://api.github.com/users/antonini/events{/privacy}","received_events_url":"https://api.github.com/users/antonini/received_events","type":"User","site_admin":false},"body":"Implemented a take action to check CORS parameters. Issue #258","created_at":"2015-06-01T04:03:09Z","updated_at":"2015-06-02T03:48:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c8f848a85700e785e4e03f96ae1325a9435dedfc","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/yegor256/takes/pulls/326/commits","review_comments_url":"https://api.github.com/repos/yegor256/takes/pulls/326/comments","review_comment_url":"https://api.github.com/repos/yegor256/takes/pulls/comments{/number}","comments_url":"https://api.github.com/repos/yegor256/takes/issues/326/comments","statuses_url":"https://api.github.com/repos/yegor256/takes/statuses/7478971d0b1d956604d1684edb103886e08b3f92","head":{"label":"antonini:issue_258","ref":"issue_258","sha":"7478971d0b1d956604d1684edb103886e08b3f92","user":{"login":"antonini","id":209396,"avatar_url":"https://avatars.githubusercontent.com/u/209396?v=3","gravatar_id":"","url":"https://api.github.com/users/antonini","html_url":"https://github.com/antonini","followers_url":"https://api.github.com/users/antonini/followers","following_url":"https://api.github.com/users/antonini/following{/other_user}","gists_url":"https://api.github.com/users/antonini/gists{/gist_id}","starred_url":"https://api.github.com/users/antonini/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/antonini/subscriptions","organizations_url":"https://api.github.com/users/antonini/orgs","repos_url":"https://api.github.com/users/antonini/repos","events_url":"https://api.github.com/users/antonini/events{/privacy}","received_events_url":"https://api.github.com/users/antonini/received_events","type":"User","site_admin":false},"repo":{"id":35812931,"name":"takes","full_name":"antonini/takes","owner":{"login":"antonini","id":209396,"avatar_url":"https://avatars.githubusercontent.com/u/209396?v=3","gravatar_id":"","url":"https://api.github.com/users/antonini","html_url":"https://github.com/antonini","followers_url":"https://api.github.com/users/antonini/followers","following_url":"https://api.github.com/users/antonini/following{/other_user}","gists_url":"https://api.github.com/users/antonini/gists{/gist_id}","starred_url":"https://api.github.com/users/antonini/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/antonini/subscriptions","organizations_url":"https://api.github.com/users/antonini/orgs","repos_url":"https://api.github.com/users/antonini/repos","events_url":"https://api.github.com/users/antonini/events{/privacy}","received_events_url":"https://api.github.com/users/antonini/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/antonini/takes","description":"True Object-Oriented and Immutable Java Web Framework","fork":true,"url":"https://api.github.com/repos/antonini/takes","forks_url":"https://api.github.com/repos/antonini/takes/forks","keys_url":"https://api.github.com/repos/antonini/takes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/antonini/takes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/antonini/takes/teams","hooks_url":"https://api.github.com/repos/antonini/takes/hooks","issue_events_url":"https://api.github.com/repos/antonini/takes/issues/events{/number}","events_url":"https://api.github.com/repos/antonini/takes/events","assignees_url":"https://api.github.com/repos/antonini/takes/assignees{/user}","branches_url":"https://api.github.com/repos/antonini/takes/branches{/branch}","tags_url":"https://api.github.com/repos/antonini/takes/tags","blobs_url":"https://api.github.com/repos/antonini/takes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/antonini/takes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/antonini/takes/git/refs{/sha}","trees_url":"https://api.github.com/repos/antonini/takes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/antonini/takes/statuses/{sha}","languages_url":"https://api.github.com/repos/antonini/takes/languages","stargazers_url":"https://api.github.com/repos/antonini/takes/stargazers","contributors_url":"https://api.github.com/repos/antonini/takes/contributors","subscribers_url":"https://api.github.com/repos/antonini/takes/subscribers","subscription_url":"https://api.github.com/repos/antonini/takes/subscription","commits_url":"https://api.github.com/repos/antonini/takes/commits{/sha}","git_commits_url":"https://api.github.com/repos/antonini/takes/git/commits{/sha}","comments_url":"https://api.github.com/repos/antonini/takes/comments{/number}","issue_comment_url":"https://api.github.com/repos/antonini/takes/issues/comments{/number}","contents_url":"https://api.github.com/repos/antonini/takes/contents/{+path}","compare_url":"https://api.github.com/repos/antonini/takes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/antonini/takes/merges","archive_url":"https://api.github.com/repos/antonini/takes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/antonini/takes/downloads","issues_url":"https://api.github.com/repos/antonini/takes/issues{/number}","pulls_url":"https://api.github.com/repos/antonini/takes/pulls{/number}","milestones_url":"https://api.github.com/repos/antonini/takes/milestones{/number}","notifications_url":"https://api.github.com/repos/antonini/takes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/antonini/takes/labels{/name}","releases_url":"https://api.github.com/repos/antonini/takes/releases{/id}","created_at":"2015-05-18T11:02:18Z","updated_at":"2015-05-18T11:02:19Z","pushed_at":"2015-06-02T03:30:10Z","git_url":"git://github.com/antonini/takes.git","ssh_url":"git@github.com:antonini/takes.git","clone_url":"https://github.com/antonini/takes.git","svn_url":"https://github.com/antonini/takes","homepage":"http://www.takes.org","size":27638,"stargazers_count":0,"watchers_count":0,"language":"Java","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":"yegor256:master","ref":"master","sha":"43b3a19d2885c2c03f4357bb387031a19fe1fcf1","user":{"login":"yegor256","id":526301,"avatar_url":"https://avatars.githubusercontent.com/u/526301?v=3","gravatar_id":"","url":"https://api.github.com/users/yegor256","html_url":"https://github.com/yegor256","followers_url":"https://api.github.com/users/yegor256/followers","following_url":"https://api.github.com/users/yegor256/following{/other_user}","gists_url":"https://api.github.com/users/yegor256/gists{/gist_id}","starred_url":"https://api.github.com/users/yegor256/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yegor256/subscriptions","organizations_url":"https://api.github.com/users/yegor256/orgs","repos_url":"https://api.github.com/users/yegor256/repos","events_url":"https://api.github.com/users/yegor256/events{/privacy}","received_events_url":"https://api.github.com/users/yegor256/received_events","type":"User","site_admin":false},"repo":{"id":28924109,"name":"takes","full_name":"yegor256/takes","owner":{"login":"yegor256","id":526301,"avatar_url":"https://avatars.githubusercontent.com/u/526301?v=3","gravatar_id":"","url":"https://api.github.com/users/yegor256","html_url":"https://github.com/yegor256","followers_url":"https://api.github.com/users/yegor256/followers","following_url":"https://api.github.com/users/yegor256/following{/other_user}","gists_url":"https://api.github.com/users/yegor256/gists{/gist_id}","starred_url":"https://api.github.com/users/yegor256/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yegor256/subscriptions","organizations_url":"https://api.github.com/users/yegor256/orgs","repos_url":"https://api.github.com/users/yegor256/repos","events_url":"https://api.github.com/users/yegor256/events{/privacy}","received_events_url":"https://api.github.com/users/yegor256/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/yegor256/takes","description":"True Object-Oriented and Immutable Java Web Framework","fork":false,"url":"https://api.github.com/repos/yegor256/takes","forks_url":"https://api.github.com/repos/yegor256/takes/forks","keys_url":"https://api.github.com/repos/yegor256/takes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yegor256/takes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yegor256/takes/teams","hooks_url":"https://api.github.com/repos/yegor256/takes/hooks","issue_events_url":"https://api.github.com/repos/yegor256/takes/issues/events{/number}","events_url":"https://api.github.com/repos/yegor256/takes/events","assignees_url":"https://api.github.com/repos/yegor256/takes/assignees{/user}","branches_url":"https://api.github.com/repos/yegor256/takes/branches{/branch}","tags_url":"https://api.github.com/repos/yegor256/takes/tags","blobs_url":"https://api.github.com/repos/yegor256/takes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yegor256/takes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yegor256/takes/git/refs{/sha}","trees_url":"https://api.github.com/repos/yegor256/takes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yegor256/takes/statuses/{sha}","languages_url":"https://api.github.com/repos/yegor256/takes/languages","stargazers_url":"https://api.github.com/repos/yegor256/takes/stargazers","contributors_url":"https://api.github.com/repos/yegor256/takes/contributors","subscribers_url":"https://api.github.com/repos/yegor256/takes/subscribers","subscription_url":"https://api.github.com/repos/yegor256/takes/subscription","commits_url":"https://api.github.com/repos/yegor256/takes/commits{/sha}","git_commits_url":"https://api.github.com/repos/yegor256/takes/git/commits{/sha}","comments_url":"https://api.github.com/repos/yegor256/takes/comments{/number}","issue_comment_url":"https://api.github.com/repos/yegor256/takes/issues/comments{/number}","contents_url":"https://api.github.com/repos/yegor256/takes/contents/{+path}","compare_url":"https://api.github.com/repos/yegor256/takes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yegor256/takes/merges","archive_url":"https://api.github.com/repos/yegor256/takes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yegor256/takes/downloads","issues_url":"https://api.github.com/repos/yegor256/takes/issues{/number}","pulls_url":"https://api.github.com/repos/yegor256/takes/pulls{/number}","milestones_url":"https://api.github.com/repos/yegor256/takes/milestones{/number}","notifications_url":"https://api.github.com/repos/yegor256/takes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yegor256/takes/labels{/name}","releases_url":"https://api.github.com/repos/yegor256/takes/releases{/id}","created_at":"2015-01-07T16:57:47Z","updated_at":"2015-06-02T02:21:01Z","pushed_at":"2015-06-02T03:30:10Z","git_url":"git://github.com/yegor256/takes.git","ssh_url":"git@github.com:yegor256/takes.git","clone_url":"https://github.com/yegor256/takes.git","svn_url":"https://github.com/yegor256/takes","homepage":"http://www.takes.org","size":35586,"stargazers_count":60,"watchers_count":60,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":35,"mirror_url":null,"open_issues_count":45,"forks":35,"open_issues":45,"watchers":60,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/yegor256/takes/pulls/326"},"html":{"href":"https://github.com/yegor256/takes/pull/326"},"issue":{"href":"https://api.github.com/repos/yegor256/takes/issues/326"},"comments":{"href":"https://api.github.com/repos/yegor256/takes/issues/326/comments"},"review_comments":{"href":"https://api.github.com/repos/yegor256/takes/pulls/326/comments"},"review_comment":{"href":"https://api.github.com/repos/yegor256/takes/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/yegor256/takes/pulls/326/commits"},"statuses":{"href":"https://api.github.com/repos/yegor256/takes/statuses/7478971d0b1d956604d1684edb103886e08b3f92"}}}}