{"action":"created","issue":{"url":"https://api.github.com/repos/yegor256/takes/issues/258","labels_url":"https://api.github.com/repos/yegor256/takes/issues/258/labels{/name}","comments_url":"https://api.github.com/repos/yegor256/takes/issues/258/comments","events_url":"https://api.github.com/repos/yegor256/takes/issues/258/events","html_url":"https://github.com/yegor256/takes/issues/258","id":73953242,"number":258,"title":"CORS decorator","user":{"login":"dmzaytsev","id":9972909,"avatar_url":"https://avatars.githubusercontent.com/u/9972909?v=3","gravatar_id":"","url":"https://api.github.com/users/dmzaytsev","html_url":"https://github.com/dmzaytsev","followers_url":"https://api.github.com/users/dmzaytsev/followers","following_url":"https://api.github.com/users/dmzaytsev/following{/other_user}","gists_url":"https://api.github.com/users/dmzaytsev/gists{/gist_id}","starred_url":"https://api.github.com/users/dmzaytsev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmzaytsev/subscriptions","organizations_url":"https://api.github.com/users/dmzaytsev/orgs","repos_url":"https://api.github.com/users/dmzaytsev/repos","events_url":"https://api.github.com/users/dmzaytsev/events{/privacy}","received_events_url":"https://api.github.com/users/dmzaytsev/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/yegor256/takes/labels/30%20mins","name":"30 mins","color":"eb6421"},{"url":"https://api.github.com/repos/yegor256/takes/labels/@antonini","name":"@antonini","color":"009801"},{"url":"https://api.github.com/repos/yegor256/takes/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/yegor256/takes/labels/DEV","name":"DEV","color":"bfd4f3"},{"url":"https://api.github.com/repos/yegor256/takes/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"closed","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/yegor256/takes/milestones/1","html_url":"https://github.com/yegor256/takes/milestones/1.0","labels_url":"https://api.github.com/repos/yegor256/takes/milestones/1/labels","id":1069705,"number":1,"title":"1.0","description":"first fully working version","creator":{"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},"open_issues":17,"closed_issues":75,"state":"open","created_at":"2015-04-16T00:55:10Z","updated_at":"2015-06-14T09:06:58Z","due_on":"2015-05-14T07:00:00Z","closed_at":null},"comments":18,"created_at":"2015-05-07T11:36:14Z","updated_at":"2015-06-14T10:23:02Z","closed_at":"2015-06-12T16:43:22Z","body":"At the moment Takes doesn't support [CORS](http://www.w3.org/TR/cors/) \r\nI believe a CORS decorator has to be. It allows browser's request to Takes-based resources on another domain.\r\n\r\nI think we can start from this\r\n```\r\nclass TkCors implements Take {\r\n  TkCors(Take take, String ... domains)\r\n}\r\n```\r\n* If the `Origin` header not present in the request skip all steps below.\r\n* If the `Origin` header is present in the request and the domains list is empty add a single `Access-Control-Allow-Origin` header to the response with  the value of the `Origin` header.\r\n* If in previous step the domains list is not empty then the `Origin` header should match for any of the values in list of domains. Add same header as step above. If header doesn't match skip all steps. \r\n* Add a single `Access-Control-Allow-Credentials` header with the string `true` as value.\r\n* Add a single  `Access-Control-Allow-Methods` header with the string `OPTIONS,GET,PUT,POST,DELETE,HEAD` as value."},"comment":{"url":"https://api.github.com/repos/yegor256/takes/issues/comments/111810397","html_url":"https://github.com/yegor256/takes/issues/258#issuecomment-111810397","issue_url":"https://api.github.com/repos/yegor256/takes/issues/258","id":111810397,"user":{"login":"davvd","id":6305016,"avatar_url":"https://avatars.githubusercontent.com/u/6305016?v=3","gravatar_id":"","url":"https://api.github.com/users/davvd","html_url":"https://github.com/davvd","followers_url":"https://api.github.com/users/davvd/followers","following_url":"https://api.github.com/users/davvd/following{/other_user}","gists_url":"https://api.github.com/users/davvd/gists{/gist_id}","starred_url":"https://api.github.com/users/davvd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davvd/subscriptions","organizations_url":"https://api.github.com/users/davvd/orgs","repos_url":"https://api.github.com/users/davvd/repos","events_url":"https://api.github.com/users/davvd/events{/privacy}","received_events_url":"https://api.github.com/users/davvd/received_events","type":"User","site_admin":false},"created_at":"2015-06-14T10:23:02Z","updated_at":"2015-06-14T10:23:02Z","body":"@antonini 10 mins was added to the account of @ypshenychka (for QA review), in transaction 59118657\n\nMuch appreciated! **30 mins** was added to your account, payment ID `AP-7LX03090UJ9369809`, time spent is 361 hours and 42 mins\n\n+30 added to your rating, current score is: [+136](http://www.netbout.com/b/35346?open=rating)"}}