mirror of
https://github.com/mickael-kerjean/filestash
synced 2025-12-06 08:22:24 +01:00
Merge branch 'master' of https://github.com/mickael-kerjean/filestash
This commit is contained in:
commit
ef122a7c48
1 changed files with 8 additions and 0 deletions
|
|
@ -226,6 +226,14 @@ func (s S3Backend) Rm(path string) error {
|
||||||
return NewError("Doesn't exist", 404)
|
return NewError("Doesn't exist", 404)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if !strings.HasSuffix(p.path, "/") {
|
||||||
|
_, err := client.DeleteObject(&s3.DeleteObjectInput{
|
||||||
|
Bucket: aws.String(p.bucket),
|
||||||
|
Key: &p.path,
|
||||||
|
})
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
objs, err := client.ListObjects(&s3.ListObjectsInput{
|
objs, err := client.ListObjects(&s3.ListObjectsInput{
|
||||||
Bucket: aws.String(p.bucket),
|
Bucket: aws.String(p.bucket),
|
||||||
Prefix: aws.String(p.path),
|
Prefix: aws.String(p.path),
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue