From 5072d70f3810acf5e57f93a43a02b030a0616102 Mon Sep 17 00:00:00 2001 From: Toby Allen Date: Mon, 13 Feb 2017 21:22:19 +0000 Subject: [PATCH 1/2] Fix for #1388 dont attempt to hide Caddyfile if non existant --- caddyhttp/httpserver/plugin.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/caddyhttp/httpserver/plugin.go b/caddyhttp/httpserver/plugin.go index c1bd6a57..9401f222 100644 --- a/caddyhttp/httpserver/plugin.go +++ b/caddyhttp/httpserver/plugin.go @@ -55,6 +55,12 @@ func init() { func hideCaddyfile(cctx caddy.Context) error { ctx := cctx.(*httpContext) for _, cfg := range ctx.siteConfigs { + + // if no Caddyfile exists exit. + if cfg.originCaddyfile == "" { + return nil + } + absRoot, err := filepath.Abs(cfg.Root) if err != nil { return err From 1a7612071acdfe746a22abf6923358385c50537a Mon Sep 17 00:00:00 2001 From: Toby Allen Date: Mon, 13 Feb 2017 21:28:19 +0000 Subject: [PATCH 2/2] remove whitespace --- caddyhttp/httpserver/plugin.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/caddyhttp/httpserver/plugin.go b/caddyhttp/httpserver/plugin.go index 9401f222..9faf5ac3 100644 --- a/caddyhttp/httpserver/plugin.go +++ b/caddyhttp/httpserver/plugin.go @@ -55,12 +55,10 @@ func init() { func hideCaddyfile(cctx caddy.Context) error { ctx := cctx.(*httpContext) for _, cfg := range ctx.siteConfigs { - // if no Caddyfile exists exit. if cfg.originCaddyfile == "" { return nil } - absRoot, err := filepath.Abs(cfg.Root) if err != nil { return err