mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
Fix a file name parsing error
This commit is contained in:
parent
72490bc00f
commit
ae3245f1dc
|
@ -9,6 +9,7 @@ import (
|
||||||
"mime"
|
"mime"
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
|
"path/filepath"
|
||||||
"runtime"
|
"runtime"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
@ -268,7 +269,7 @@ func parseURLPath(path string) (vid, fid, filename, ext string) {
|
||||||
if strings.Count(path, "/") == 3 {
|
if strings.Count(path, "/") == 3 {
|
||||||
parts := strings.Split(path, "/")
|
parts := strings.Split(path, "/")
|
||||||
vid, fid, filename = parts[1], parts[2], parts[3]
|
vid, fid, filename = parts[1], parts[2], parts[3]
|
||||||
ext = filename[strings.LastIndex(filename, "."):]
|
ext = filepath.Ext(filename)
|
||||||
} else {
|
} else {
|
||||||
sepIndex := strings.LastIndex(path, "/")
|
sepIndex := strings.LastIndex(path, "/")
|
||||||
commaIndex := strings.LastIndex(path[sepIndex:], ",")
|
commaIndex := strings.LastIndex(path[sepIndex:], ",")
|
||||||
|
@ -317,7 +318,7 @@ func runVolume(cmd *Command, args []string) bool {
|
||||||
log.Fatalf("Volume Folder should not be a file:%s", folder)
|
log.Fatalf("Volume Folder should not be a file:%s", folder)
|
||||||
}
|
}
|
||||||
perm := fileInfo.Mode().Perm()
|
perm := fileInfo.Mode().Perm()
|
||||||
log.Println("Volume Folder", folder)
|
log.Println("Volume Folder", folder)
|
||||||
log.Println("Permission:", perm)
|
log.Println("Permission:", perm)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue