Skip to content

Commit

Permalink
fix: write does not take effect on the current dir (close #1711)
Browse files Browse the repository at this point in the history
  • Loading branch information
xhofe committed Sep 19, 2022
1 parent d6d82c3 commit 5548ab6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server/handles/fsmanage.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func FsMkdir(c *gin.Context) {
user := c.MustGet("user").(*model.User)
req.Path = stdpath.Join(user.BasePath, req.Path)
if !user.CanWrite() {
meta, err := db.GetNearestMeta(req.Path)
meta, err := db.GetNearestMeta(stdpath.Dir(req.Path))
if err != nil {
if !errors.Is(errors.Cause(err), errs.MetaNotFound) {
common.ErrorResp(c, err, 500, true)
Expand Down Expand Up @@ -199,7 +199,7 @@ func FsPut(c *gin.Context) {
user := c.MustGet("user").(*model.User)
path = stdpath.Join(user.BasePath, path)
if !user.CanWrite() {
meta, err := db.GetNearestMeta(path)
meta, err := db.GetNearestMeta(stdpath.Dir(path))
if err != nil {
if !errors.Is(errors.Cause(err), errs.MetaNotFound) {
common.ErrorResp(c, err, 500, true)
Expand Down

0 comments on commit 5548ab6

Please sign in to comment.