Yandex Cloud Functions Post Request how to overcome CORS?

Welcome. There is a function that sends an email.

exports.handler = async (event, context) => {
 const { name, phone, email } = JSON.parse(event.body);

 ... send letters ...

 return {
 statusCode: 200
};
};


Using Postman everything is OK.
Using CORS Anywhere - everything is OK.

Using axios, fetch, etc. (all from the front):

Access to fetch at 'https://functions.yandexcloud.net/***********' from origin 'https://xd71v.***********.io' has been blocked by CORS policy: Response to a preflight request doesn't pass the access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request''s mode to 'no-cors' to fetch the resource with CORS disabled.

POST https://functions.yandexcloud.net/*********** net::ERR_FAILED


The header "Access-Control-Allow-Origin" in the response body was added - no change.

Prompt in what direction to look, where to dig. Thank you.
April 19th 20 at 12:10
0 answer

Find more questions by tags CORSYandex