mirror of
https://github.com/pgsty/minio.git
synced 2026-07-20 04:30:26 +03:00
Implement x-amz-acl handling
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user