summaryrefslogtreecommitdiff
path: root/modules/caddyhttp/fileserver
diff options
context:
space:
mode:
Diffstat (limited to 'modules/caddyhttp/fileserver')
-rw-r--r--modules/caddyhttp/fileserver/caddyfile.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/modules/caddyhttp/fileserver/caddyfile.go b/modules/caddyhttp/fileserver/caddyfile.go
index 6fa94e7..902bd14 100644
--- a/modules/caddyhttp/fileserver/caddyfile.go
+++ b/modules/caddyhttp/fileserver/caddyfile.go
@@ -76,6 +76,15 @@ func parseCaddyfile(h httpcaddyfile.Helper) (caddyhttp.MiddlewareHandler, error)
fsrv.Root = "{http.var.root}"
}
+ // hide the Caddyfile (and any imported Caddyfiles)
+ if configFiles := h.Caddyfiles(); len(configFiles) > 0 {
+ for _, file := range configFiles {
+ if !fileHidden(file, fsrv.Hide) {
+ fsrv.Hide = append(fsrv.Hide, file)
+ }
+ }
+ }
+
return &fsrv, nil
}