mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
ensure file name does not contain any "/"
This commit is contained in:
parent
f2af477324
commit
0b7a235c17
|
@ -6,6 +6,7 @@ import (
|
|||
"io/ioutil"
|
||||
"mime"
|
||||
"net/http"
|
||||
"path"
|
||||
"pkg/util"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
@ -50,6 +51,7 @@ func NewNeedle(r *http.Request) (n *Needle, fname string, e error) {
|
|||
return
|
||||
}
|
||||
fname = part.FileName()
|
||||
fname = path.Base(fname)
|
||||
data, _ := ioutil.ReadAll(part)
|
||||
dotIndex := strings.LastIndex(fname, ".")
|
||||
ext, mtype := "", ""
|
||||
|
|
Loading…
Reference in a new issue