Browse Source

rename function

pull/1616/head
Chris Lu 4 years ago
parent
commit
c6a0704019
  1. 2
      weed/s3api/filer_util.go
  2. 4
      weed/s3api/s3api_bucket_handlers.go

2
weed/s3api/filer_util.go

@ -76,7 +76,7 @@ func (s3a *S3ApiServer) exists(parentDirectoryPath string, entryName string, isD
}
func (s3a *S3ApiServer) get(parentDirectoryPath, entryName string) (entry *filer_pb.Entry, err error) {
func (s3a *S3ApiServer) getEntry(parentDirectoryPath, entryName string) (entry *filer_pb.Entry, err error) {
fullPath := util.NewFullPath(parentDirectoryPath, entryName)
return filer_pb.GetEntry(s3a, fullPath)
}

4
weed/s3api/s3api_bucket_handlers.go

@ -120,7 +120,7 @@ func (s3a *S3ApiServer) DeleteBucketHandler(w http.ResponseWriter, r *http.Reque
bucket, _ := getBucketAndObject(r)
entry, err := s3a.get(s3a.option.BucketsPath, bucket)
entry, err := s3a.getEntry(s3a.option.BucketsPath, bucket)
if entry == nil || err == filer_pb.ErrNotFound {
writeErrorResponse(w, s3err.ErrNoSuchBucket, r.URL)
return
@ -164,8 +164,8 @@ func (s3a *S3ApiServer) HeadBucketHandler(w http.ResponseWriter, r *http.Request
bucket, _ := getBucketAndObject(r)
entry, err := s3a.get(s3a.option.BucketsPath, bucket)
if entry == nil || err != nil {
entry, err := s3a.getEntry(s3a.option.BucketsPath, bucket)
writeErrorResponse(w, s3err.ErrNoSuchBucket, r.URL)
return
}

Loading…
Cancel
Save