如何解决Apache Ignite中的CORS?

awe*_*pro 2 java cors ignite

我有一个在基本Java应用程序中运行的Apache Ignite服务器。Ignite REST api在某个端口上公开。当我从浏览器中点击它时,它正在返回所需的响应。但是,从Angular应用程序中,我收到了CORS错误。

有什么解决办法吗?请注意,此应用程序运行Ignite REST api(提供CORS的API)。如何在Ignite REST API中允许跨域?

小智 5

不幸的是,我还没有听说过实现该目标的正确方法。 可以通过过滤API 配置CORS Jetty中的过滤。此功能由ServletHandler提供。看来,利用其自身的处理程序来服务请求。据我了解,它不支持跨域请求。ServletIgniteHTTP

In general I don't think that it's good idea to direct HTTP request to an Ignite cluster from a browser. It doesn't look absolutely secure and architecturally correct. I'd prefer to have separate back-end application which should be responsible for processing of your Angular application load.