feat: update alist-org/gofakes3 to v0.0.7 to support create folder in PutObject (#6880)

This commit is contained in:
Hao Jiakang
2024-07-27 20:06:05 +08:00
committed by GitHub
parent 8b5727a0aa
commit af9c6afd25
3 changed files with 19 additions and 8 deletions

View File

@ -267,8 +267,19 @@ func (b *s3Backend) PutObject(
}
bucketPath := bucket.Path
isDir := strings.HasSuffix(objectName, "/")
log.Debugf("isDir: %v", isDir)
fp := path.Join(bucketPath, objectName)
reqPath := path.Dir(fp)
log.Debugf("fp: %s, bucketPath: %s, objectName: %s", fp, bucketPath, objectName)
var reqPath string
if isDir {
reqPath = fp + "/"
} else {
reqPath = path.Dir(fp)
}
log.Debugf("reqPath: %s", reqPath)
fmeta, _ := op.GetNearestMeta(fp)
ctx = context.WithValue(ctx, "meta", fmeta)
@ -285,6 +296,10 @@ func (b *s3Backend) PutObject(
}
}
if isDir {
return result, nil
}
var ti time.Time
if val, ok := meta["X-Amz-Meta-Mtime"]; ok {