|
|
@ -118,17 +118,15 @@ func (api Minio) ListMultipartUploadsHandler(w http.ResponseWriter, req *http.Re |
|
|
|
// write body
|
|
|
|
// write body
|
|
|
|
w.Write(encodedSuccessResponse) |
|
|
|
w.Write(encodedSuccessResponse) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
case donut.SignatureDoesNotMatch: |
|
|
|
|
|
|
|
writeErrorResponse(w, req, SignatureDoesNotMatch, acceptsContentType, req.URL.Path) |
|
|
|
case donut.BucketNotFound: |
|
|
|
case donut.BucketNotFound: |
|
|
|
{ |
|
|
|
|
|
|
|
writeErrorResponse(w, req, NoSuchBucket, acceptsContentType, req.URL.Path) |
|
|
|
writeErrorResponse(w, req, NoSuchBucket, acceptsContentType, req.URL.Path) |
|
|
|
} |
|
|
|
|
|
|
|
default: |
|
|
|
default: |
|
|
|
{ |
|
|
|
|
|
|
|
log.Error.Println(iodine.New(err, nil)) |
|
|
|
log.Error.Println(iodine.New(err, nil)) |
|
|
|
writeErrorResponse(w, req, InternalError, acceptsContentType, req.URL.Path) |
|
|
|
writeErrorResponse(w, req, InternalError, acceptsContentType, req.URL.Path) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// ListObjectsHandler - GET Bucket (List Objects)
|
|
|
|
// ListObjectsHandler - GET Bucket (List Objects)
|
|
|
|
// -------------------------
|
|
|
|
// -------------------------
|
|
|
@ -185,6 +183,8 @@ func (api Minio) ListObjectsHandler(w http.ResponseWriter, req *http.Request) { |
|
|
|
setCommonHeaders(w, getContentTypeString(acceptsContentType), len(encodedSuccessResponse)) |
|
|
|
setCommonHeaders(w, getContentTypeString(acceptsContentType), len(encodedSuccessResponse)) |
|
|
|
// write body
|
|
|
|
// write body
|
|
|
|
w.Write(encodedSuccessResponse) |
|
|
|
w.Write(encodedSuccessResponse) |
|
|
|
|
|
|
|
case donut.SignatureDoesNotMatch: |
|
|
|
|
|
|
|
writeErrorResponse(w, req, SignatureDoesNotMatch, acceptsContentType, req.URL.Path) |
|
|
|
case donut.BucketNameInvalid: |
|
|
|
case donut.BucketNameInvalid: |
|
|
|
writeErrorResponse(w, req, InvalidBucketName, acceptsContentType, req.URL.Path) |
|
|
|
writeErrorResponse(w, req, InvalidBucketName, acceptsContentType, req.URL.Path) |
|
|
|
case donut.BucketNotFound: |
|
|
|
case donut.BucketNotFound: |
|
|
@ -242,6 +242,8 @@ func (api Minio) ListBucketsHandler(w http.ResponseWriter, req *http.Request) { |
|
|
|
setCommonHeaders(w, getContentTypeString(acceptsContentType), len(encodedSuccessResponse)) |
|
|
|
setCommonHeaders(w, getContentTypeString(acceptsContentType), len(encodedSuccessResponse)) |
|
|
|
// write response
|
|
|
|
// write response
|
|
|
|
w.Write(encodedSuccessResponse) |
|
|
|
w.Write(encodedSuccessResponse) |
|
|
|
|
|
|
|
case donut.SignatureDoesNotMatch: |
|
|
|
|
|
|
|
writeErrorResponse(w, req, SignatureDoesNotMatch, acceptsContentType, req.URL.Path) |
|
|
|
default: |
|
|
|
default: |
|
|
|
log.Error.Println(iodine.New(err, nil)) |
|
|
|
log.Error.Println(iodine.New(err, nil)) |
|
|
|
writeErrorResponse(w, req, InternalError, acceptsContentType, req.URL.Path) |
|
|
|
writeErrorResponse(w, req, InternalError, acceptsContentType, req.URL.Path) |
|
|
@ -300,6 +302,8 @@ func (api Minio) PutBucketHandler(w http.ResponseWriter, req *http.Request) { |
|
|
|
// Make sure to add Location information here only for bucket
|
|
|
|
// Make sure to add Location information here only for bucket
|
|
|
|
w.Header().Set("Location", "/"+bucket) |
|
|
|
w.Header().Set("Location", "/"+bucket) |
|
|
|
writeSuccessResponse(w, acceptsContentType) |
|
|
|
writeSuccessResponse(w, acceptsContentType) |
|
|
|
|
|
|
|
case donut.SignatureDoesNotMatch: |
|
|
|
|
|
|
|
writeErrorResponse(w, req, SignatureDoesNotMatch, acceptsContentType, req.URL.Path) |
|
|
|
case donut.TooManyBuckets: |
|
|
|
case donut.TooManyBuckets: |
|
|
|
writeErrorResponse(w, req, TooManyBuckets, acceptsContentType, req.URL.Path) |
|
|
|
writeErrorResponse(w, req, TooManyBuckets, acceptsContentType, req.URL.Path) |
|
|
|
case donut.BucketNameInvalid: |
|
|
|
case donut.BucketNameInvalid: |
|
|
@ -352,6 +356,8 @@ func (api Minio) PutBucketACLHandler(w http.ResponseWriter, req *http.Request) { |
|
|
|
switch iodine.ToError(err).(type) { |
|
|
|
switch iodine.ToError(err).(type) { |
|
|
|
case nil: |
|
|
|
case nil: |
|
|
|
writeSuccessResponse(w, acceptsContentType) |
|
|
|
writeSuccessResponse(w, acceptsContentType) |
|
|
|
|
|
|
|
case donut.SignatureDoesNotMatch: |
|
|
|
|
|
|
|
writeErrorResponse(w, req, SignatureDoesNotMatch, acceptsContentType, req.URL.Path) |
|
|
|
case donut.BucketNameInvalid: |
|
|
|
case donut.BucketNameInvalid: |
|
|
|
writeErrorResponse(w, req, InvalidBucketName, acceptsContentType, req.URL.Path) |
|
|
|
writeErrorResponse(w, req, InvalidBucketName, acceptsContentType, req.URL.Path) |
|
|
|
case donut.BucketNotFound: |
|
|
|
case donut.BucketNotFound: |
|
|
@ -398,6 +404,8 @@ func (api Minio) HeadBucketHandler(w http.ResponseWriter, req *http.Request) { |
|
|
|
switch iodine.ToError(err).(type) { |
|
|
|
switch iodine.ToError(err).(type) { |
|
|
|
case nil: |
|
|
|
case nil: |
|
|
|
writeSuccessResponse(w, acceptsContentType) |
|
|
|
writeSuccessResponse(w, acceptsContentType) |
|
|
|
|
|
|
|
case donut.SignatureDoesNotMatch: |
|
|
|
|
|
|
|
writeErrorResponse(w, req, SignatureDoesNotMatch, acceptsContentType, req.URL.Path) |
|
|
|
case donut.BucketNotFound: |
|
|
|
case donut.BucketNotFound: |
|
|
|
error := getErrorCode(NoSuchBucket) |
|
|
|
error := getErrorCode(NoSuchBucket) |
|
|
|
w.WriteHeader(error.HTTPStatusCode) |
|
|
|
w.WriteHeader(error.HTTPStatusCode) |
|
|
|