Skip to content

Commit

Permalink
fix: fix isadminAPI value name
Browse files Browse the repository at this point in the history
  • Loading branch information
flywukong committed Oct 19, 2023
1 parent c79a656 commit fdf8f1c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions client/api_bucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
}
Expand Down Expand Up @@ -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,
},
}
Expand Down
4 changes: 2 additions & 2 deletions client/api_challenge.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
}
Expand Down
6 changes: 3 additions & 3 deletions client/api_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down Expand Up @@ -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)
}
Expand Down Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion client/api_object.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
}
Expand Down

0 comments on commit fdf8f1c

Please sign in to comment.