rename argument from url to apiInfo

This commit is contained in:
Anton Evangelatov 2021-07-12 11:36:22 +02:00
parent a423c46f2a
commit 056136ef5a

View File

@ -726,11 +726,11 @@ func StorageAuth(ctx helpers.MetricsCtx, ca v0api.Common) (sectorstorage.Storage
return sectorstorage.StorageAuth(headers), nil return sectorstorage.StorageAuth(headers), nil
} }
func StorageAuthWithURL(url string) func(ctx helpers.MetricsCtx, ca v0api.Common) (sectorstorage.StorageAuth, error) { func StorageAuthWithURL(apiInfo string) func(ctx helpers.MetricsCtx, ca v0api.Common) (sectorstorage.StorageAuth, error) {
return func(ctx helpers.MetricsCtx, ca v0api.Common) (sectorstorage.StorageAuth, error) { return func(ctx helpers.MetricsCtx, ca v0api.Common) (sectorstorage.StorageAuth, error) {
s := strings.Split(url, ":") s := strings.Split(apiInfo, ":")
if len(s) != 2 { if len(s) != 2 {
return nil, errors.New("unexpected format of URL") return nil, errors.New("unexpected format of `apiInfo`")
} }
headers := http.Header{} headers := http.Header{}
headers.Add("Authorization", "Bearer "+s[0]) headers.Add("Authorization", "Bearer "+s[0])