1
0
Fork 0
mirror of https://github.com/chrislusf/seaweedfs synced 2024-09-03 23:50:36 +02:00

avoid auto unzip tar.gz files

fix https://github.com/chrislusf/weed-fs/issues/90
This commit is contained in:
chrislusf 2015-02-25 21:26:45 -08:00
parent 89a06a8503
commit 4ee766e966

View file

@ -126,7 +126,8 @@ func ParseUpload(r *http.Request) (fileName string, data []byte, mimeType string
if ext == ".gz" {
isGzipped = true
}
if strings.HasSuffix(fileName, ".gz") {
if strings.HasSuffix(fileName, ".gz") &&
!strings.HasSuffix(fileName, ".tar.gz") {
fileName = fileName[:len(fileName)-3]
}
modifiedTime, _ = strconv.ParseUint(r.FormValue("ts"), 10, 64)