bc862e52 by astaxie

Merge pull request #271 from shavac/master

minor fix,if path does not include ':', beego will crash of "index out of range"
2 parents a4df6e40 290a9d18
...@@ -185,7 +185,7 @@ func ParseConfig() (err error) { ...@@ -185,7 +185,7 @@ func ParseConfig() (err error) {
185 } 185 }
186 sds := strings.Fields(sd) 186 sds := strings.Fields(sd)
187 for _, v := range sds { 187 for _, v := range sds {
188 if url2fsmap := strings.SplitN(v, ":", 2); url2fsmap[1] != "" { 188 if url2fsmap := strings.SplitN(v, ":", 2); len(url2fsmap) == 2 {
189 StaticDir["/"+url2fsmap[0]] = url2fsmap[1] 189 StaticDir["/"+url2fsmap[0]] = url2fsmap[1]
190 } else { 190 } else {
191 StaticDir["/"+url2fsmap[0]] = url2fsmap[0] 191 StaticDir["/"+url2fsmap[0]] = url2fsmap[0]
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!