未验证 提交 8979d3a6 编写于 作者: S soulseen

filter jenkins header

Signed-off-by: Nsoulseen <sunzhu@yunify.com>
上级 96e32cc0
......@@ -23,8 +23,11 @@ import (
log "github.com/golang/glog"
"kubesphere.io/kubesphere/pkg/models/devops"
"net/http"
"strings"
)
const jenkinsHeaderPre = "X-"
func GetPipeline(req *restful.Request, resp *restful.Response) {
projectName := req.PathParameter("projectName")
pipelineName := req.PathParameter("pipelineName")
......@@ -111,7 +114,9 @@ func GetBranchStepLog(req *restful.Request, resp *restful.Response) {
return
}
for k, v := range header {
resp.AddHeader(k, v[0])
if strings.HasPrefix(k, jenkinsHeaderPre) {
resp.AddHeader(k, v[0])
}
}
resp.Write(res)
}
......@@ -129,7 +134,9 @@ func GetStepLog(req *restful.Request, resp *restful.Response) {
return
}
for k, v := range header {
resp.AddHeader(k, v[0])
if strings.HasPrefix(k, jenkinsHeaderPre) {
resp.AddHeader(k, v[0])
}
}
resp.Write(res)
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册