提交 679c3936 编写于 作者: S SampsonYe

fix: coding.net docker registry realm has special characters

上级 2319affd
......@@ -43,11 +43,13 @@ func TryLoginRegistry(basicUrl, username, password string, insecure bool) error
kvArr := strings.Split(auth[7:], ",")
for _, i2 := range kvArr {
temp := strings.Split(i2, "=")
if strings.HasPrefix(i2, "realm") {
authBaseUrl = strings.Trim(temp[1], "\"")
index := strings.Index(i2, "=")
if index == -1 {
continue
} else if strings.EqualFold(strings.Trim(i2[:index], " "), "realm") {
authBaseUrl = strings.Trim(i2[index+1:], "\"")
} else {
queryParams = append(queryParams, temp[0]+"="+strings.Trim(temp[1], "\""))
queryParams = append(queryParams, i2[:index]+"="+strings.Trim(i2[index+1:], "\""))
}
}
} else {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册