Browse Source

fix response error

pull/5760/head
Konstantin Lebedev 6 months ago
parent
commit
1d055cf871
  1. 7
      weed/s3api/s3api_object_handlers_delete.go

7
weed/s3api/s3api_object_handlers_delete.go

@ -30,10 +30,9 @@ func (s3a *S3ApiServer) DeleteObjectHandler(w http.ResponseWriter, r *http.Reque
target := util.FullPath(fmt.Sprintf("%s/%s%s", s3a.option.BucketsPath, bucket, object)) target := util.FullPath(fmt.Sprintf("%s/%s%s", s3a.option.BucketsPath, bucket, object))
dir, name := target.DirAndName() dir, name := target.DirAndName()
s3a.WithFilerClient(false, func(client filer_pb.SeaweedFilerClient) error {
err := s3a.WithFilerClient(false, func(client filer_pb.SeaweedFilerClient) error {
if err := doDeleteEntry(client, dir, name, true, false); err != nil { if err := doDeleteEntry(client, dir, name, true, false); err != nil {
w.WriteHeader(http.StatusInternalServerError)
return err return err
} }
@ -52,6 +51,10 @@ func (s3a *S3ApiServer) DeleteObjectHandler(w http.ResponseWriter, r *http.Reque
return nil return nil
}) })
if err != nil {
s3err.WriteErrorResponse(w, r, s3err.ErrInternalError)
return
}
w.WriteHeader(http.StatusNoContent) w.WriteHeader(http.StatusNoContent)
} }

Loading…
Cancel
Save