我正在尝试通过 javascript 应用程序访问我的 jenkins 服务器的 API 以获取一些构建数据。尝试发出请求时,我收到 CORS 错误,尽管我为 jenkins 启用了 CORS 插件
这是我在控制台中得到的错误
Access to fetch at (my_jenkins_server) from origin 'http://localhost:3000' has been blocked by CORS policy: 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.
在抓取中,我包含以下标题:
headers: new Headers({ 'Content-Type': 'application/json', 'Authorization': 'Basic ' + btoa('jenkin_user:jenkin_token')
类似于这里的这个问题Jenkins CORS Filter plugin not adding Access-Control-Allow-Origins header
关于这个问题的任何更新?