Merge pull request #9780 from filecoin-project/fix/parse-api-urls

fix: cliutil: Fix URL-based API endpoint parsing
This commit is contained in:
Łukasz Magiera 2022-12-02 22:09:40 +01:00 committed by GitHub
commit 1791db57f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -43,13 +43,7 @@ func ParseApiInfoMulti(s string) []APIInfo {
allAddrs := strings.SplitN(s, ",", -1)
for _, addr := range allAddrs {
if infoWithToken.Match([]byte(addr)) {
sp := strings.SplitN(addr, ":", 2)
apiInfos = append(apiInfos, APIInfo{
Addr: sp[1],
Token: []byte(sp[0]),
})
}
apiInfos = append(apiInfos, ParseApiInfo(addr))
}
return apiInfos