CORS Error when attempting to fetch Calendar Feed

Jump to solution
a_1234
Community Member

An front end web app I have made fetches the canvas calendar feed and is meant to render it. It works for other applications but for canvas, I am getting a cors error and the only way to bypass this is by using a proxy. I have tried using a proxy and it works, but this is not an ideal solution. Is there a way to fix this? The calendar states that it should work for "any" calendar app that takes ical feeds, so it should be allowed to work for mine, right? 

0 Likes
1 Solution
seanbeirnes
Community Participant

Yes, @a_1234, if Instructure sent down the "Access-Control-Allow-Origin" header for calendar feeds, then it could relieve your problem, but the allowed origin would need to be the wildcard (i.e. any domain could access it) and/or specifically list the domain of your application. Otherwise, it still would not work without the proxy.

Instructure probably has no incentive to send down those headers since I would assume those calendar feeds are mostly used by users who add them to apps like Outlook, iCloud, etc., and those are not bound by CORS since a lot of that processing happens on the server side. Using the wildcard origin could introduce security vulnerabilities for cross-site scripting attacks that would not even be possible with the current set up, and since calendar feeds are usually something that does not get processed by client-side JavaScript in the browser, I think it would be unlikely to see this changed.

View solution in original post