Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: sector accessor auth URL handling for ipv6 #1950

Merged
merged 1 commit into from
Aug 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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