Commit 00abdcd0 authored by astaxie's avatar astaxie

Merge pull request #269 from shavac/master

improve StaticDir config file parser.
parents c6167ef1 73a2081a
......@@ -180,9 +180,16 @@ func ParseConfig() (err error) {
BeegoServerName = serverName
}
if sd := AppConfig.String("StaticDir"); sd != "" {
sds := strings.Split(sd, ",")
for k := range StaticDir {
delete(StaticDir, k)
}
sds := strings.Fields(sd)
for _, v := range sds {
StaticDir["/"+v] = v
if url2fsmap := strings.SplitN(v, ":", 2); url2fsmap[1] != "" {
StaticDir["/"+url2fsmap[0]] = url2fsmap[1]
} else {
StaticDir["/"+url2fsmap[0]] = url2fsmap[0]
}
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment