You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Set the function options to use CORS with an array of single item (domain)
Deploy function
Make request to function from matching domain in CORS opts
Observe CORS error
[REQUIRED] Expected behavior
CORS options containing an array of a single domain works as expected-- the same as passing the single item unwrapped.
[REQUIRED] Actual behavior
The array of a single CORS option leads it to be ignored, specifically when using onCall and not onRequest as that was fixed.
Access to fetch at 'https://us-central1-my-project-id.cloudfunctions.net/getGreeting' from origin 'https://my-project-id.web.app' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: The 'Access-Control-Allow-Origin' header contains the invalid value 'my-project-id.web.app'. Have the server send the header with a valid value, or, if an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
Were you able to successfully deploy your functions?
Functions deploy fine, but requests are blocked because of CORS
The text was updated successfully, but these errors were encountered:
Related issues
This PR #1544 fixed the very same issue for
onRequest
but not foronCall
, both which originated in #1536[REQUIRED] Version info
node: 18.7.1
firebase-functions: 5.0.1
firebase-tools: 13.8.0
firebase-admin:
[REQUIRED] Test case
[REQUIRED] Steps to reproduce
onCall
function[REQUIRED] Expected behavior
CORS options containing an array of a single domain works as expected-- the same as passing the single item unwrapped.
[REQUIRED] Actual behavior
The array of a single CORS option leads it to be ignored, specifically when using
onCall
and notonRequest
as that was fixed.Were you able to successfully deploy your functions?
Functions deploy fine, but requests are blocked because of CORS
The text was updated successfully, but these errors were encountered: