0

I'm trying to test an https.onCall function but I keep getting Access to fetch at 'https://<project>.cloudfunctions.net/<func>' from origin 'http://localhost:8081' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: Redirect is not allowed for a preflight request.

I've also tried running it in the emulator, but I get the same result because the ports don't match. I have no idea how to enable CORS for an onCall function.

Chris B.
  • 85,731
  • 25
  • 98
  • 139
  • Have you checked [Firebase callable functions + cors](https://stackoverflow.com/questions/50278537/firebase-callable-function-cors?) ? – Dharmaraj Sep 24 '21 at 05:48
  • I have, but none of it seemed to help. – Chris B. Sep 25 '21 at 04:08
  • If the accepted answer from[1] did not shed some light, can you please add a reproducible piece of code to the question? or share a redacted github repo? [1]https://stackoverflow.com/questions/50278537/firebase-callable-function-cors? – Antonio Ramirez Sep 27 '21 at 22:52

0 Answers0