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 -1
View File
@@ -38,7 +38,7 @@ type ErrorResponse struct {
HostID string
}
// Error codes, non exhaustive list
// Error codes, non exhaustive list - http://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html
const (
AccessDenied = iota
BadDigest
@@ -63,6 +63,11 @@ const (
TooManyBuckets
)
// Error codes, non exhaustive list - standard HTTP errors
const (
NotAcceptable = iota + 21
)
// Error code to Error structure map
var errorCodeResponse = map[int]Error{
AccessDenied: {
@@ -170,6 +175,12 @@ var errorCodeResponse = map[int]Error{
Description: "You have attempted to create more buckets than allowed.",
HTTPStatusCode: http.StatusBadRequest,
},
NotAcceptable: {
Code: "NotAcceptable",
Description: `The requested resource is only capable of generating content
not acceptable according to the Accept headers sent in the request.`,
HTTPStatusCode: http.StatusNotAcceptable,
},
}
// errorCodeError provides errorCode to Error. It returns empty if the code provided is unknown