Skip to content

Commit

Permalink
fix auth URL hanlding for ipv6 (#1950)
Browse files Browse the repository at this point in the history
  • Loading branch information
LexLuthr authored Aug 20, 2024
1 parent 7e463cd commit 72acb67
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions cmd/lib/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package lib

import (
"context"
"errors"
"fmt"
"net/http"
"strings"
Expand Down Expand Up @@ -90,10 +89,7 @@ func GetMinerApi(ctx context.Context, ai string, log *logging.ZapEventLogger) (v
}

func StorageAuthWithURL(apiInfo string) (sealer.StorageAuth, error) {
s := strings.Split(apiInfo, ":")
if len(s) != 2 {
return nil, errors.New("unexpected format of `apiInfo`")
}
s := strings.SplitN(apiInfo, ":", 2)
headers := http.Header{}
headers.Add("Authorization", "Bearer "+s[0])
return sealer.StorageAuth(headers), nil
Expand Down

0 comments on commit 72acb67

Please sign in to comment.