diff options
| author | Chris Lu <chris.lu@gmail.com> | 2013-07-15 17:26:00 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2013-07-15 17:26:00 -0700 |
| commit | 5e3b6e968a930a735fcb208bfeda372fe9ba7efc (patch) | |
| tree | 643b3e6eb5175da86c8009d5c254cb06c1fab03b /go/weed/volume.go | |
| parent | dd66193bfbc36bb43bace01e2f88fe52f983c838 (diff) | |
| download | seaweedfs-5e3b6e968a930a735fcb208bfeda372fe9ba7efc.tar.xz seaweedfs-5e3b6e968a930a735fcb208bfeda372fe9ba7efc.zip | |
escaping upload file name special characters
if already gzipped, avoid gzipping again
Diffstat (limited to 'go/weed/volume.go')
| -rw-r--r-- | go/weed/volume.go | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/go/weed/volume.go b/go/weed/volume.go index dbc0ee547..a22babd45 100644 --- a/go/weed/volume.go +++ b/go/weed/volume.go @@ -272,13 +272,13 @@ func parseURLPath(path string) (vid, fid, filename, ext string) { vid, fid, filename = parts[1], parts[2], parts[3] ext = filepath.Ext(filename) case 2: - parts := strings.Split(path, "/") - vid, fid = parts[1], parts[2] - dotIndex := strings.LastIndex(fid, ".") - if dotIndex > 0 { - ext = fid[dotIndex:] - fid = fid[0:dotIndex] - } + parts := strings.Split(path, "/") + vid, fid = parts[1], parts[2] + dotIndex := strings.LastIndex(fid, ".") + if dotIndex > 0 { + ext = fid[dotIndex:] + fid = fid[0:dotIndex] + } default: sepIndex := strings.LastIndex(path, "/") commaIndex := strings.LastIndex(path[sepIndex:], ",") |
