mirror of
https://github.com/pgsty/minio.git
synced 2026-08-10 16:23:28 +03:00
minio: Replace 'bucket already exists' error by 'bucket already owned by you'. (#1465)
S3 API returns BucketAlreadyExists error when some another user has such bucket. If user that creates the bucket already has it, s3 returns BucketAlreadyOwnedByYou. As minio has only one user, it should behave accordingly. Otherwise it causes failures in the applications that ignore creation of already existing bucket in the account, but fail when bucket name is used by someone else.
This commit is contained in:
+1
-1
@@ -499,7 +499,7 @@ func (api objectAPIHandlers) PutBucketHandler(w http.ResponseWriter, r *http.Req
|
||||
case BucketNameInvalid:
|
||||
writeErrorResponse(w, r, ErrInvalidBucketName, r.URL.Path)
|
||||
case BucketExists:
|
||||
writeErrorResponse(w, r, ErrBucketAlreadyExists, r.URL.Path)
|
||||
writeErrorResponse(w, r, ErrBucketAlreadyOwnedByYou, r.URL.Path)
|
||||
default:
|
||||
writeErrorResponse(w, r, ErrInternalError, r.URL.Path)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user