So when I am triggering a Netlify function from client side I am geting the following error
So i suspected it might be due preflight request issue. So I have added the OPTIONS method as shown below.
So OPTIONS method does return ‘Access-Control-Allow-Origin’: '*'
Netlify function when triggered from a REST Client does return ‘Access-Control-Allow-Origin’: ‘*’ in the response headers.
But when triggering from client side , I am getting the aforementioned error. Why am i getting the 502 Bad Gateway error from Netlify ?