Browse Source

check if bucket already exists.

pull/1612/head
ruitao.liu 4 years ago
parent
commit
d7cc0498e0
  1. 3
      weed/s3api/s3api_bucket_handlers.go

3
weed/s3api/s3api_bucket_handlers.go

@ -89,6 +89,9 @@ func (s3a *S3ApiServer) PutBucketHandler(w http.ResponseWriter, r *http.Request)
writeErrorResponse(w, s3err.ErrInternalError, r.URL)
return
}
if exist, err := s3a.exists(s3a.option.BucketsPath, bucket, true); err == nil && exist {
errCode = s3err.ErrBucketAlreadyExists
}
if errCode != s3err.ErrNone {
writeErrorResponse(w, errCode, r.URL)
return

Loading…
Cancel
Save