1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-26 12:01:29 +00:00

Merge pull request #271 from shavac/master

minor fix,if path does not include ':', beego will crash of "index out of range"
This commit is contained in:
astaxie 2013-11-01 04:57:07 -07:00
commit bc862e526d

View File

@ -185,7 +185,7 @@ func ParseConfig() (err error) {
} }
sds := strings.Fields(sd) sds := strings.Fields(sd)
for _, v := range sds { for _, v := range sds {
if url2fsmap := strings.SplitN(v, ":", 2); url2fsmap[1] != "" { if url2fsmap := strings.SplitN(v, ":", 2); len(url2fsmap) == 2 {
StaticDir["/"+url2fsmap[0]] = url2fsmap[1] StaticDir["/"+url2fsmap[0]] = url2fsmap[1]
} else { } else {
StaticDir["/"+url2fsmap[0]] = url2fsmap[0] StaticDir["/"+url2fsmap[0]] = url2fsmap[0]