490747a8 by astaxie

fix #52

1 parent d4610a93
...@@ -65,6 +65,7 @@ func init() { ...@@ -65,6 +65,7 @@ func init() {
65 EnableGzip = false 65 EnableGzip = false
66 StaticDir["/static"] = "static" 66 StaticDir["/static"] = "static"
67 AppConfigPath = path.Join(AppPath, "conf", "app.conf") 67 AppConfigPath = path.Join(AppPath, "conf", "app.conf")
68 ParseConfig()
68 } 69 }
69 70
70 type App struct { 71 type App struct {
......
...@@ -75,8 +75,8 @@ func LoadConfig(name string) (*Config, error) { ...@@ -75,8 +75,8 @@ func LoadConfig(name string) (*Config, error) {
75 } 75 }
76 76
77 val := bytes.SplitN(line, bEqual, 2) 77 val := bytes.SplitN(line, bEqual, 2)
78 if bytes.HasPrefix(val[1], bDQuote) { 78 if bytes.HasPrefix(strings.TrimSpace(string(val[1])), bDQuote) {
79 val[1] = bytes.Trim(val[1], `"`) 79 val[1] = bytes.Trim(strings.TrimSpace(string(val[1])), `"`)
80 } 80 }
81 81
82 key := strings.TrimSpace(string(val[0])) 82 key := strings.TrimSpace(string(val[0]))
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!