{"action":"created","issue":{"url":"https://api.github.com/repos/syncthing/syncthing/issues/2735","labels_url":"https://api.github.com/repos/syncthing/syncthing/issues/2735/labels{/name}","comments_url":"https://api.github.com/repos/syncthing/syncthing/issues/2735/comments","events_url":"https://api.github.com/repos/syncthing/syncthing/issues/2735/events","html_url":"https://github.com/syncthing/syncthing/pull/2735","id":128935644,"number":2735,"title":"Proper CORS support","user":{"login":"letiemble","id":127328,"avatar_url":"https://avatars.githubusercontent.com/u/127328?v=3","gravatar_id":"","url":"https://api.github.com/users/letiemble","html_url":"https://github.com/letiemble","followers_url":"https://api.github.com/users/letiemble/followers","following_url":"https://api.github.com/users/letiemble/following{/other_user}","gists_url":"https://api.github.com/users/letiemble/gists{/gist_id}","starred_url":"https://api.github.com/users/letiemble/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/letiemble/subscriptions","organizations_url":"https://api.github.com/users/letiemble/orgs","repos_url":"https://api.github.com/users/letiemble/repos","events_url":"https://api.github.com/users/letiemble/events{/privacy}","received_events_url":"https://api.github.com/users/letiemble/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-01-26T20:40:19Z","updated_at":"2016-01-26T20:52:04Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/syncthing/syncthing/pulls/2735","html_url":"https://github.com/syncthing/syncthing/pull/2735","diff_url":"https://github.com/syncthing/syncthing/pull/2735.diff","patch_url":"https://github.com/syncthing/syncthing/pull/2735.patch"},"body":"When calling the REST API from a webpage on a different domain, the browser performs a preflight OPTIONS request as described in the [CORS standard](https://www.w3.org/TR/cors/) because of the \"X-API-Key\" header.\r\n\r\nCurrently, Syncthing does not handle OPTIONS requests. In order to allow CORS request from a different domain, Syncthing needs to respond properly to OPTIONS requests by returning the appropriate headers.\r\n\r\nThis PR provides a new handler that deals with OPTIONS requests. Basic test case included."},"comment":{"url":"https://api.github.com/repos/syncthing/syncthing/issues/comments/175224270","html_url":"https://github.com/syncthing/syncthing/pull/2735#issuecomment-175224270","issue_url":"https://api.github.com/repos/syncthing/syncthing/issues/2735","id":175224270,"user":{"login":"calmh","id":125426,"avatar_url":"https://avatars.githubusercontent.com/u/125426?v=3","gravatar_id":"","url":"https://api.github.com/users/calmh","html_url":"https://github.com/calmh","followers_url":"https://api.github.com/users/calmh/followers","following_url":"https://api.github.com/users/calmh/following{/other_user}","gists_url":"https://api.github.com/users/calmh/gists{/gist_id}","starred_url":"https://api.github.com/users/calmh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/calmh/subscriptions","organizations_url":"https://api.github.com/users/calmh/orgs","repos_url":"https://api.github.com/users/calmh/repos","events_url":"https://api.github.com/users/calmh/events{/privacy}","received_events_url":"https://api.github.com/users/calmh/received_events","type":"User","site_admin":false},"created_at":"2016-01-26T20:52:04Z","updated_at":"2016-01-26T20:52:04Z","body":"Looks good to me, thanks!"}}