Open ritzelpaket opened 6 years ago
Could someone fix this please?
I can have a look at it as soon as possible, i guess today. What do you think about this? https://github.com/ottoyiu/django-cors-headers
I just flew over.. but it seems to be the right thing. I had a similar problem in Node. A Middleware was also the solution.
This commit may resolve the issue: https://github.com/Kodkollektivet/unitime-api/commit/a76b7f2a8ffed9b12db60d68cf64cffebff40b3c
Browser console logs:
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://api.kodkollektivet.se/api/event/. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing).
If the application runs on the same domain, the error possibly won't show. But on a development machine or different domain you actually can't call the API without enabling CORS globally in the browser.
Same for other resources like
/course
.