Commit 396d8e98 authored by magikstm's avatar magikstm Committed by Matt Holt

internal: add internal paths to HiddenFiles (#2133)

* Append Internal paths to Caddy config HiddenFiles

* gofmt

* Reuse a variable

* Update caddyhttp/internalsrv/setup.go
Co-Authored-By: default avatarmagikstm <myskina@gmail.com>
parent 33b00dc8
...@@ -33,7 +33,12 @@ func setup(c *caddy.Controller) error { ...@@ -33,7 +33,12 @@ func setup(c *caddy.Controller) error {
return err 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} return Internal{Next: next, Paths: paths}
}) })
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment