Implement x-amz-acl handling

This commit is contained in:
Harshavardhana
2015-04-22 16:28:13 -07:00
parent 28785421cd
commit 107e077ec0
9 changed files with 182 additions and 34 deletions
+12
View File
@@ -17,6 +17,7 @@
package api
import (
"net/http"
"sort"
"github.com/minio-io/minio/pkg/storage/drivers"
@@ -107,3 +108,14 @@ func generateObjectsListResult(bucket string, objects []drivers.ObjectMetadata,
data.CommonPrefixes = prefixes
return data
}
func writeErrorResponse(w http.ResponseWriter, req *http.Request, errorType int, acceptsContentType contentType, resource string) {
error := getErrorCode(errorType)
errorResponse := getErrorResponse(error, resource)
// set headers
setCommonHeaders(w, getContentTypeString(acceptsContentType))
w.WriteHeader(error.HTTPStatusCode)
// write body
encodedErrorResponse := encodeErrorResponse(errorResponse, acceptsContentType)
w.Write(encodedErrorResponse)
}