{"action":"created","issue":{"url":"https://api.github.com/repos/libasys/calendarplus/issues/171","labels_url":"https://api.github.com/repos/libasys/calendarplus/issues/171/labels{/name}","comments_url":"https://api.github.com/repos/libasys/calendarplus/issues/171/comments","events_url":"https://api.github.com/repos/libasys/calendarplus/issues/171/events","html_url":"https://github.com/libasys/calendarplus/issues/171","id":106524488,"number":171,"title":"1.1.0 - Allow Cross-Origin Resource Sharing","user":{"login":"mattsches","id":68414,"avatar_url":"https://avatars.githubusercontent.com/u/68414?v=3","gravatar_id":"","url":"https://api.github.com/users/mattsches","html_url":"https://github.com/mattsches","followers_url":"https://api.github.com/users/mattsches/followers","following_url":"https://api.github.com/users/mattsches/following{/other_user}","gists_url":"https://api.github.com/users/mattsches/gists{/gist_id}","starred_url":"https://api.github.com/users/mattsches/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattsches/subscriptions","organizations_url":"https://api.github.com/users/mattsches/orgs","repos_url":"https://api.github.com/users/mattsches/repos","events_url":"https://api.github.com/users/mattsches/events{/privacy}","received_events_url":"https://api.github.com/users/mattsches/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-09-15T10:08:55Z","updated_at":"2015-09-15T16:19:16Z","closed_at":null,"body":"It would be nice to be able to request subscriptions of public calendars from within the client (by means of XMLHttpRequests).\r\n\r\nThe reason I want this is that I have a static web page, and I want to pull and parse events from a public OwnCloud Calendar+ calendar using JS.\r\n\r\nThis can be easily achieved by adding the `@CORS` annotation to the `ExportController::exportEvents()` method (as long as it doesn't have any security implicatons I'm not aware of yet). See also: https://doc.owncloud.org/server/8.1/developer_manual/app/tutorial.html#adding-a-restful-api-optional\r\n\r\n<bountysource-plugin>\r\n---\r\nWant to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/26696567-1-1-0-allow-cross-origin-resource-sharing?utm_campaign=plugin&utm_content=tracker%2F19394737&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F19394737&utm_medium=issues&utm_source=github).\r\n</bountysource-plugin>"},"comment":{"url":"https://api.github.com/repos/libasys/calendarplus/issues/comments/140449253","html_url":"https://github.com/libasys/calendarplus/issues/171#issuecomment-140449253","issue_url":"https://api.github.com/repos/libasys/calendarplus/issues/171","id":140449253,"user":{"login":"mattsches","id":68414,"avatar_url":"https://avatars.githubusercontent.com/u/68414?v=3","gravatar_id":"","url":"https://api.github.com/users/mattsches","html_url":"https://github.com/mattsches","followers_url":"https://api.github.com/users/mattsches/followers","following_url":"https://api.github.com/users/mattsches/following{/other_user}","gists_url":"https://api.github.com/users/mattsches/gists{/gist_id}","starred_url":"https://api.github.com/users/mattsches/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattsches/subscriptions","organizations_url":"https://api.github.com/users/mattsches/orgs","repos_url":"https://api.github.com/users/mattsches/repos","events_url":"https://api.github.com/users/mattsches/events{/privacy}","received_events_url":"https://api.github.com/users/mattsches/received_events","type":"User","site_admin":false},"created_at":"2015-09-15T16:19:16Z","updated_at":"2015-09-15T16:19:16Z","body":"Ok, so far so good ;) However, if I try to request the .ics file via an AJAX call from one `domain`, for example, mywebsite.com, and the Owncloud instance is on `another_domain` owncloud.example.com - I get an error (in the JS console of the browser) because my browser sent an `Origin` header:\r\n`XMLHttpRequest cannot load https://{domain}/index.php/apps/calendarplus/exporteventscalendar?t={token}. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://{another_domain}' is therefore not allowed access.`\r\n\r\nThat's because the cross-origin resource sharing header is missing from the response. The header will be set if the above mentioned annotation is added to the code. This will add a wildcard Access-Control-Allow-Origin header.\r\n\r\nIf it helps, I can mail you a live example :)"}}