Fix for #1388 dont attempt to hide Caddyfile if non existant

This commit is contained in:
Toby Allen 2017-02-13 21:22:19 +00:00
parent ce7d3db1be
commit 5072d70f38

View File

@ -55,6 +55,12 @@ func init() {
func hideCaddyfile(cctx caddy.Context) error { func hideCaddyfile(cctx caddy.Context) error {
ctx := cctx.(*httpContext) ctx := cctx.(*httpContext)
for _, cfg := range ctx.siteConfigs { for _, cfg := range ctx.siteConfigs {
// if no Caddyfile exists exit.
if cfg.originCaddyfile == "" {
return nil
}
absRoot, err := filepath.Abs(cfg.Root) absRoot, err := filepath.Abs(cfg.Root)
if err != nil { if err != nil {
return err return err