gokulsivaOriginal post
@everyone
Hi, I couldn't find a way to solve cors for the function with the custom domain I've added.
For Project level custom domain it is handled by the hostname and platform combination.
Please share me the solution / workaround if any.
Summary
To enable CORS for a function with a custom domain, developers need to manually add the CORS headers to their response. An example of allowing all origins is:
```js
return res.json(response, 200, {'Access-Control-Allow-Origin': '*'});
```
For project-level custom domains, CORS is handled by the combination of the hostname and platform. Developers must add the necessary CORS headers to their function's response for CORS to work properly.