SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.
Go blob-storagecloud-drivedistributed-file-systemdistributed-storageerasure-codingfusehadoop-hdfshdfskuberneteslancelancedbobject-storageposixs3s3-storageseaweedfstiered-file-systemvector-search
S3: fail fast when "X-Amz-Copy-Source" is a folder
chrislu77362700e16c
diff --git a/weed/s3api/s3api_object_copy_handlers.go b/weed/s3api/s3api_object_copy_handlers.goindex 5c082eedac..f62db9c310 100644--- a/weed/s3api/s3api_object_copy_handlers.go+++ b/weed/s3api/s3api_object_copy_handlers.go@@ -34,11 +34,7 @@ func (s3a *S3ApiServer) CopyObjectHandler(w http.ResponseWriter, r *http.RequestfullPath := util.FullPath(fmt.Sprintf("%s/%s%s", s3a.option.BucketsPath, dstBucket, dstObject))dir, name := fullPath.DirAndName()entry, err := s3a.getEntry(dir, name)- if err != nil {- s3err.WriteErrorResponse(w, r, s3err.ErrInvalidCopySource)- return- }- if entry.IsDirectory {+ if err != nil || entry.IsDirectory {s3err.WriteErrorResponse(w, r, s3err.ErrInvalidCopySource)return}@@ -62,8 +58,7 @@ func (s3a *S3ApiServer) CopyObjectHandler(w http.ResponseWriter, r *http.Request}srcPath := util.FullPath(fmt.Sprintf("%s/%s%s", s3a.option.BucketsPath, srcBucket, srcObject))dir, name := srcPath.DirAndName()- _, err = s3a.getEntry(dir, name)- if err != nil {+ if entry, err := s3a.getEntry(dir, name); err != nil || entry.IsDirectory {s3err.WriteErrorResponse(w, r, s3err.ErrInvalidCopySource)return}