diff options
| author | chrislusf <chris.lu@gmail.com> | 2015-02-25 21:26:45 -0800 |
|---|---|---|
| committer | chrislusf <chris.lu@gmail.com> | 2015-02-25 23:59:44 -0800 |
| commit | 4ee766e966aba41cd6d60b5449b080ee0922693c (patch) | |
| tree | 48ba01900dd7f52d656060348b42551ac285e6f9 | |
| parent | 89a06a8503f084b5972ce050352f4546aa39782e (diff) | |
| download | seaweedfs-4ee766e966aba41cd6d60b5449b080ee0922693c.tar.xz seaweedfs-4ee766e966aba41cd6d60b5449b080ee0922693c.zip | |
avoid auto unzip tar.gz files
fix https://github.com/chrislusf/weed-fs/issues/90
| -rw-r--r-- | go/storage/needle.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/go/storage/needle.go b/go/storage/needle.go index e4994da3f..85806f3cb 100644 --- a/go/storage/needle.go +++ b/go/storage/needle.go @@ -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) |
