How to enabel CORS for flutter web Apps?

Access to XMLHttpRequest at ‘https://fcm.googleapis.com/fcm/notification’ from origin ‘https://ecomnetworks.netlify.app’ has been blocked by CORS policy: Response to preflight request doesn’t pass access control check: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.

main.dart.js:5365 XMLHttpRequest error.

main.dart.js:46540 POST https://fcm.googleapis.com/fcm/notification net::ERR_FAILED

Please someone help me, I am new to CORS and web apps

Hi there,

Unfortunately I don’t have a perfect answer for you, but you might find this blog post interesting:

You can manipulate CORS on netlify by adding a Content-Security-Policy Header to Netlify: