diff --git a/caddyhttp/internalsrv/setup.go b/caddyhttp/internalsrv/setup.go index 35c79d274..f70147ac8 100644 --- a/caddyhttp/internalsrv/setup.go +++ b/caddyhttp/internalsrv/setup.go @@ -33,7 +33,12 @@ func setup(c *caddy.Controller) error { return err } - httpserver.GetConfig(c).AddMiddleware(func(next httpserver.Handler) httpserver.Handler { + // Append Internal paths to Caddy config HiddenFiles to ensure + // files do not appear in Browse + config := httpserver.GetConfig(c) + config.HiddenFiles = append(config.HiddenFiles, paths...) + + config.AddMiddleware(func(next httpserver.Handler) httpserver.Handler { return Internal{Next: next, Paths: paths} })