Skip to content

Commit

Permalink
fix: use const to judge version
Browse files Browse the repository at this point in the history
  • Loading branch information
flywukong committed Oct 19, 2023
1 parent 3da3129 commit c79a656
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions client/api_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -550,9 +550,10 @@ func (c *Client) generateURL(bucketName string, objectName string, relativePath
var urlStr string
if adminInfo.isAdminApi {
var prefix string
if adminInfo.adminVersion == 1 {
// check the version and generate the url by the version
if adminInfo.adminVersion == types.AdminV1Version {
prefix = types.AdminURLPrefix + types.AdminURLV1Version
} else if adminInfo.adminVersion == 2 {
} else if adminInfo.adminVersion == types.AdminV2Version {
prefix = types.AdminURLPrefix + types.AdminURLV2Version
} else {
return nil, fmt.Errorf("invalid admin version %d", adminInfo.adminVersion)
Expand Down

0 comments on commit c79a656

Please sign in to comment.