在预检响应中,Access-Control-Allow-Headers不允许请求头字段kbn-version

时间:2017-08-11 07:21:54

标签: jquery ajax elasticsearch cors kibana

我在yml文件中设置了Kibana配置详细信息,如下所示,

System.out.println(ImagePath.getBundlePath());

但我的jQuery Ajax调用仍然出现错误"在预检响应"中,Access-Control-Allow-Headers不允许使用请求头字段kbn-version。感谢您在解决此问题方面的帮助。

1 个答案:

答案 0 :(得分:0)

感谢@slidehowbarker,对我来说,我在Elasticsearch中对其进行了配置。

elasticsearch / config / 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"