Various fixes/tweaks to HTTP placeholder variables and file matching

- Rename http.var.* -> http.vars.* to be more consistent
- Prefixing a path matcher with * now invokes simple suffix matching
- Handlers and matchers that need a root path default to {http.vars.root}
- Clean replacer output on the file matcher's file selection suffix
This commit is contained in:
Matthew Holt
2019-09-06 12:36:45 -06:00
parent 21d7b662e7
commit 14f9662f9c
8 changed files with 25 additions and 23 deletions

View File

@ -57,6 +57,10 @@ func (FileServer) CaddyModule() caddy.ModuleInfo {
// Provision sets up the static files responder.
func (fsrv *FileServer) Provision(ctx caddy.Context) error {
if fsrv.Root == "" {
fsrv.Root = "{http.vars.root}"
}
if fsrv.IndexNames == nil {
fsrv.IndexNames = defaultIndexNames
}