api: Requests should be differentiated if possible based on http router. (#2219)
In current master ListObjectsV2 was merged into ListObjectsHandler which also implements V1 API as well. Move the detection of ListObject types to its rightful place in http router.
This commit is contained in:
@@ -561,8 +561,8 @@ func getDeleteBucketURL(endPoint, bucketName string) string {
|
||||
|
||||
}
|
||||
|
||||
// return URL for listing the bucket.
|
||||
func getListObjectsURL(endPoint, bucketName string, maxKeys string) string {
|
||||
// return URL for listing objects in the bucket with V1 legacy API.
|
||||
func getListObjectsV1URL(endPoint, bucketName string, maxKeys string) string {
|
||||
queryValue := url.Values{}
|
||||
if maxKeys != "" {
|
||||
queryValue.Set("max-keys", maxKeys)
|
||||
@@ -570,6 +570,16 @@ func getListObjectsURL(endPoint, bucketName string, maxKeys string) string {
|
||||
return makeTestTargetURL(endPoint, bucketName, "", queryValue)
|
||||
}
|
||||
|
||||
// return URL for listing objects in the bucket with V2 API.
|
||||
func getListObjectsV2URL(endPoint, bucketName string, maxKeys string) string {
|
||||
queryValue := url.Values{}
|
||||
queryValue.Set("list-type", "2") // Enables list objects V2 URL.
|
||||
if maxKeys != "" {
|
||||
queryValue.Set("max-keys", maxKeys)
|
||||
}
|
||||
return makeTestTargetURL(endPoint, bucketName, "", queryValue)
|
||||
}
|
||||
|
||||
// return URL for a new multipart upload.
|
||||
func getNewMultipartURL(endPoint, bucketName, objectName string) string {
|
||||
queryValue := url.Values{}
|
||||
|
||||
Reference in New Issue
Block a user