show fake dirs

https://github.com/chrislusf/seaweedfs/issues/3086
This commit is contained in:
Konstantin Lebedev
2022-05-30 15:03:27 +05:00
parent 54356211c2
commit 26f3646961
2 changed files with 14 additions and 10 deletions

View File

@@ -93,7 +93,10 @@ func (s3a *S3ApiServer) PutObjectHandler(w http.ResponseWriter, r *http.Request)
defer dataReader.Close()
if strings.HasSuffix(object, "/") {
if err := s3a.mkdir(s3a.option.BucketsPath, bucket+object, nil); err != nil {
if err := s3a.mkdir(s3a.option.BucketsPath, bucket+strings.TrimSuffix(object, "/"), func(entry *filer_pb.Entry) {
glog.V(0).Infof("make file %s", bucket+object)
entry.Attributes.Mime = r.Header.Get("Content-Type")
}); err != nil {
s3err.WriteErrorResponse(w, r, s3err.ErrInternalError)
return
}