From 71c14fa16e351de55a304fb9b9a39abfbf6487c0 Mon Sep 17 00:00:00 2001 From: Matthew Holt Date: Sun, 5 Jun 2016 23:34:16 -0600 Subject: [PATCH] Make sure Root is set for all new SiteConfigs This situation typically only arises in tests... --- caddyhttp/httpserver/plugin.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/caddyhttp/httpserver/plugin.go b/caddyhttp/httpserver/plugin.go index ac8b19fcc..881fd8127 100644 --- a/caddyhttp/httpserver/plugin.go +++ b/caddyhttp/httpserver/plugin.go @@ -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