0
Fork 0
mirror of https://github.com/caddyserver/caddy.git synced 2024-12-23 22:27:38 -05:00

Make sure Root is set for all new SiteConfigs

This situation typically only arises in tests...
This commit is contained in:
Matthew Holt 2016-06-05 23:34:16 -06:00
parent ff22fbd79a
commit 71c14fa16e
No known key found for this signature in database
GPG key ID: 0D97CC73664F4D03

View file

@ -155,8 +155,7 @@ func GetConfig(addrKey string) *SiteConfig {
// this shouldn't happen except in tests
newContext()
}
cfg := new(SiteConfig)
cfg.TLS = new(caddytls.Config)
cfg := &SiteConfig{Root: Root, TLS: new(caddytls.Config)}
defaultCtx := contexts[len(contexts)-1]
defaultCtx.siteConfigs = append(defaultCtx.siteConfigs, cfg)
defaultCtx.keysToSiteConfigs[addrKey] = cfg