Return Owner information in ListObjectV2 only when fetch-owner is specified (#2654)

This commit is contained in:
Anis Elleuch
2016-09-10 18:44:38 +01:00
committed by Harshavardhana
parent e6abfb3b67
commit 8acf4d112a
5 changed files with 35 additions and 10 deletions

View File

@@ -706,12 +706,15 @@ func getListObjectsV1URL(endPoint, bucketName string, maxKeys string) string {
}
// return URL for listing objects in the bucket with V2 API.
func getListObjectsV2URL(endPoint, bucketName string, maxKeys string) string {
func getListObjectsV2URL(endPoint, bucketName string, maxKeys string, fetchOwner string) string {
queryValue := url.Values{}
queryValue.Set("list-type", "2") // Enables list objects V2 URL.
if maxKeys != "" {
queryValue.Set("max-keys", maxKeys)
}
if fetchOwner != "" {
queryValue.Set("fetch-owner", fetchOwner)
}
return makeTestTargetURL(endPoint, bucketName, "", queryValue)
}