Request header content-type was not present in the Access-Control-Allow-Headers list.
Any help is appreciated, struggling with this issue since some time now.
What value(s) do you have set for
http.cors.allow-headers in your
elasticsearch.yml file? And what headers are sending in your CORS request?
I had added the following in the .yml file:
http.cors.enabled : true
http.cors.allow-origin : "*"
The issue got resolved when we set the 'Content-Type': 'text/plain', earlier it was set to 'application/json' because of which it was not passing the preflight check i guess. Let me know if my understanding is correct. Thanks.
application/json is not an allowed
Content-Type for CORS requests, see: http://www.w3.org/TR/cors/#simple-header for the allowed
Content-Type values for CORS