Jenkins Cors 插件未启用访问控制允许标头

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

我正在尝试通过 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')

这是我的 CORS 插件的当前设置 here

类似于这里的这个问题Jenkins CORS Filter plugin not adding Access-Control-Allow-Origins header

jenkins cors jenkins-plugins
1个回答
-3
投票

关于这个问题的任何更新?

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