Skip to content

Commit 72acb67

Browse files
authored
fix auth URL hanlding for ipv6 (#1950)
1 parent 7e463cd commit 72acb67

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

cmd/lib/api.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package lib
22

33
import (
44
"context"
5-
"errors"
65
"fmt"
76
"net/http"
87
"strings"
@@ -90,10 +89,7 @@ func GetMinerApi(ctx context.Context, ai string, log *logging.ZapEventLogger) (v
9089
}
9190

9291
func StorageAuthWithURL(apiInfo string) (sealer.StorageAuth, error) {
93-
s := strings.Split(apiInfo, ":")
94-
if len(s) != 2 {
95-
return nil, errors.New("unexpected format of `apiInfo`")
96-
}
92+
s := strings.SplitN(apiInfo, ":", 2)
9793
headers := http.Header{}
9894
headers.Add("Authorization", "Bearer "+s[0])
9995
return sealer.StorageAuth(headers), nil

0 commit comments

Comments
 (0)