Skip to content

Commit

Permalink
chore: decode filePath in header
Browse files Browse the repository at this point in the history
  • Loading branch information
xhofe committed Aug 28, 2022
1 parent e72a557 commit e5480b9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions server/handles/fsmanage.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package handles

import (
"fmt"
"net/url"
stdpath "path"
"strconv"
"time"
Expand Down Expand Up @@ -189,6 +190,11 @@ func FsRemove(c *gin.Context) {

func FsPut(c *gin.Context) {
path := c.GetHeader("File-Path")
path, err := url.PathUnescape(path)
if err != nil {
common.ErrorResp(c, err, 400)
return
}
asTask := c.GetHeader("As-Task") == "true"
user := c.MustGet("user").(*model.User)
path = stdpath.Join(user.BasePath, path)
Expand Down

0 comments on commit e5480b9

Please sign in to comment.