From 5072d70f3810acf5e57f93a43a02b030a0616102 Mon Sep 17 00:00:00 2001 From: Toby Allen Date: Mon, 13 Feb 2017 21:22:19 +0000 Subject: [PATCH] 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 c1bd6a570..9401f222f 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