所请求的资源ListenHTTP处理器上没有'Access-Control-Allow-Origin'标头

问题描述 投票:0回答:1

我有一个Nifi集群,其流程以listenHTTP处理器开始。基本上,流接收带有JSON有效负载的POST调用。与邮递员请求或curl调用配合使用时效果很好。但是,当请求来自Web浏览器时,OPTION请求失败,并显示以下错误:

Access to fetch at 'https://{server_endpoint}/process' from 
origin 'https://{client_endpoint}:3443' has been blocked by CORS 
policy: Response to preflight request doesn't pass access control 
check: No 'Access-Control-Allow-Origin' header is present on the 
requested resource. If an opaque response serves your needs, 
set the request's mode to 'no-cors' to fetch the resource 
with CORS disabled.

我们应该如何在ListenHTTP处理器中配置cors。

apache-nifi
1个回答
0
投票

ListenHTTP不支持CORS。您唯一的选择是使用代理服务器,该代理服务器会将浏览器请求发送到NiFi集群。

© www.soinside.com 2019 - 2024. All rights reserved.