diff --git a/beego.go b/beego.go index 8c5cb10e..2fdfc005 100644 --- a/beego.go +++ b/beego.go @@ -65,6 +65,7 @@ func init() { EnableGzip = false StaticDir["/static"] = "static" AppConfigPath = path.Join(AppPath, "conf", "app.conf") + ParseConfig() } type App struct { diff --git a/config.go b/config.go index f4eca072..174195c3 100644 --- a/config.go +++ b/config.go @@ -75,8 +75,8 @@ func LoadConfig(name string) (*Config, error) { } val := bytes.SplitN(line, bEqual, 2) - if bytes.HasPrefix(val[1], bDQuote) { - val[1] = bytes.Trim(val[1], `"`) + if bytes.HasPrefix(strings.TrimSpace(string(val[1])), bDQuote) { + val[1] = bytes.Trim(strings.TrimSpace(string(val[1])), `"`) } key := strings.TrimSpace(string(val[0]))