verify Site.URL on start-up
This commit is contained in:
parent
62be4020d6
commit
9fd88bd6bc
|
@ -199,6 +199,10 @@ func ProcessConfig() (err error) {
|
||||||
Site.URL = strings.TrimSuffix(Site.URL, ":")
|
Site.URL = strings.TrimSuffix(Site.URL, ":")
|
||||||
Site.URL = Site.URL + ":" + Site.Port
|
Site.URL = Site.URL + ":" + Site.Port
|
||||||
}
|
}
|
||||||
|
uurl, err := url.Parse(Site.URL)
|
||||||
|
if err != nil {
|
||||||
|
return errors.Wrap(err, "failed to parse Site.URL: ")
|
||||||
|
}
|
||||||
if Site.EnableSsl {
|
if Site.EnableSsl {
|
||||||
Config.SslSchema = Site.EnableSsl
|
Config.SslSchema = Site.EnableSsl
|
||||||
}
|
}
|
||||||
|
@ -237,7 +241,7 @@ func ProcessConfig() (err error) {
|
||||||
local := func(h string) bool {
|
local := func(h string) bool {
|
||||||
return h == "localhost" || h == "127.0.0.1" || h == "::1" || h == Site.URL
|
return h == "localhost" || h == "127.0.0.1" || h == "::1" || h == Site.URL
|
||||||
}
|
}
|
||||||
uurl, err := url.Parse(Config.StaticResBase)
|
uurl, err = url.Parse(Config.StaticResBase)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "failed to parse Config.StaticResBase: ")
|
return errors.Wrap(err, "failed to parse Config.StaticResBase: ")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue