mirror of
https://github.com/caddyserver/caddy.git
synced 2026-05-25 08:12:31 -04:00
file_server: Automatically hide all involved Caddyfiles
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user