From fdf8f1c22799b678555be9dbf910f94ddc07ec0b Mon Sep 17 00:00:00 2001 From: flywukong <2229306838@qq.com> Date: Thu, 19 Oct 2023 15:54:44 +0800 Subject: [PATCH] fix: fix isadminAPI value name --- client/api_bucket.go | 4 ++-- client/api_challenge.go | 4 ++-- client/api_client.go | 6 +++--- client/api_object.go | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/client/api_bucket.go b/client/api_bucket.go index 960a7934..8a26179c 100644 --- a/client/api_bucket.go +++ b/client/api_bucket.go @@ -81,7 +81,7 @@ func (c *Client) GetCreateBucketApproval(ctx context.Context, createBucketMsg *s sendOpt := sendOptions{ method: http.MethodGet, adminInfo: AdminAPIInfo{ - isAdminApi: true, + isAdminAPI: true, adminVersion: types.AdminV1Version, }, } @@ -877,7 +877,7 @@ func (c *Client) GetMigrateBucketApproval(ctx context.Context, migrateBucketMsg sendOpt := sendOptions{ method: http.MethodGet, adminInfo: AdminAPIInfo{ - isAdminApi: true, + isAdminAPI: true, adminVersion: types.AdminV1Version, }, } diff --git a/client/api_challenge.go b/client/api_challenge.go index b46fd17c..9f9aeab4 100644 --- a/client/api_challenge.go +++ b/client/api_challenge.go @@ -88,12 +88,12 @@ func (c *Client) GetChallengeInfo(ctx context.Context, objectID string, pieceInd if opts.UseV2version { sendOpt.adminInfo = AdminAPIInfo{ - isAdminApi: true, + isAdminAPI: true, adminVersion: types.AdminV2Version, } } else { sendOpt.adminInfo = AdminAPIInfo{ - isAdminApi: true, + isAdminAPI: true, adminVersion: types.AdminV1Version, } } diff --git a/client/api_client.go b/client/api_client.go index b7060b4a..692f3e2b 100644 --- a/client/api_client.go +++ b/client/api_client.go @@ -304,7 +304,7 @@ type sendOptions struct { // AdminAPIInfo - the admin api info type AdminAPIInfo struct { - isAdminApi bool // indicate if it is an admin api request + isAdminAPI bool // indicate if it is an admin api request adminVersion int // indicate the version of admin api, the default value is 1 } @@ -407,7 +407,7 @@ func (c *Client) newRequest(ctx context.Context, method string, meta requestMeta req.Header.Set(types.HTTPHeaderPieceIndex, strconv.Itoa(info.PieceIndex)) } - if adminAPIInfo.isAdminApi { + if adminAPIInfo.isAdminAPI { if meta.txnMsg != "" { req.Header.Set(types.HTTPHeaderUnsignedMsg, meta.txnMsg) } @@ -548,7 +548,7 @@ func (c *Client) generateURL(bucketName string, objectName string, relativePath } var urlStr string - if adminInfo.isAdminApi { + if adminInfo.isAdminAPI { var prefix string // check the version and generate the url by the version if adminInfo.adminVersion == types.AdminV1Version { diff --git a/client/api_object.go b/client/api_object.go index b0240dde..39c6ffa8 100644 --- a/client/api_object.go +++ b/client/api_object.go @@ -991,7 +991,7 @@ func (c *Client) GetCreateObjectApproval(ctx context.Context, createObjectMsg *s sendOpt := sendOptions{ method: http.MethodGet, adminInfo: AdminAPIInfo{ - isAdminApi: true, + isAdminAPI: true, adminVersion: types.AdminV1Version, }, }