CORS policy error message with ElasticsearchJS (Kibana plugin visualization)

Hi guys,
I developed a kibana plugin visualization integrating elasticsearch-browser to comunicate with elasticsearch.
When I configure elasticsearch-browser with an angularJS application, if I try to ping my ES instance, in the console of my browser appared this errore message:

Access to XMLHttpRequest at 'http://127.0.0.1:9200/' from origin 'http://127.0.0.1:5601' has been blocked by CORS policy: Request header field kbn-version is not allowed by Access-Control-Allow-Headers in preflight response.

Why? How I do to resolve this problem?
Thank's in advance for the replies!

I resolved adding this in elasticsearch.yml

http.cors.enabled : true
http.cors.allow-origin : "*"
http.cors.allow-methods : OPTIONS, HEAD, GET, POST, PUT, DELETE
http.cors.allow-headers: "kbn-version, Origin, X-Requested-With, Content-Type, Accept, Engaged-Auth-Token"

Thanks!

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.