feat: update alist-org/gofakes3 to v0.0.7 to support create folder in PutObject (#6880)
This commit is contained in:
@ -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 {
|
||||
|
Reference in New Issue
Block a user