mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
parent
05c3c3f56b
commit
77362700e1
|
@ -34,11 +34,7 @@ func (s3a *S3ApiServer) CopyObjectHandler(w http.ResponseWriter, r *http.Request
|
||||||
fullPath := util.FullPath(fmt.Sprintf("%s/%s%s", s3a.option.BucketsPath, dstBucket, dstObject))
|
fullPath := util.FullPath(fmt.Sprintf("%s/%s%s", s3a.option.BucketsPath, dstBucket, dstObject))
|
||||||
dir, name := fullPath.DirAndName()
|
dir, name := fullPath.DirAndName()
|
||||||
entry, err := s3a.getEntry(dir, name)
|
entry, err := s3a.getEntry(dir, name)
|
||||||
if err != nil {
|
if err != nil || entry.IsDirectory {
|
||||||
s3err.WriteErrorResponse(w, r, s3err.ErrInvalidCopySource)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if entry.IsDirectory {
|
|
||||||
s3err.WriteErrorResponse(w, r, s3err.ErrInvalidCopySource)
|
s3err.WriteErrorResponse(w, r, s3err.ErrInvalidCopySource)
|
||||||
return
|
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))
|
srcPath := util.FullPath(fmt.Sprintf("%s/%s%s", s3a.option.BucketsPath, srcBucket, srcObject))
|
||||||
dir, name := srcPath.DirAndName()
|
dir, name := srcPath.DirAndName()
|
||||||
_, err = s3a.getEntry(dir, name)
|
if entry, err := s3a.getEntry(dir, name); err != nil || entry.IsDirectory {
|
||||||
if err != nil {
|
|
||||||
s3err.WriteErrorResponse(w, r, s3err.ErrInvalidCopySource)
|
s3err.WriteErrorResponse(w, r, s3err.ErrInvalidCopySource)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue