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:
Harshavardhana
2016-07-17 12:32:05 -07:00
committed by GitHub
parent 8cc163e51a
commit aaf7803831
6 changed files with 200 additions and 93 deletions

View File

@@ -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{}