summaryrefslogtreecommitdiff
path: root/modules/caddyhttp/fileserver/staticfiles.go
diff options
context:
space:
mode:
authorMatthew Holt <mholt@users.noreply.github.com>2019-09-06 12:36:45 -0600
committerMatthew Holt <mholt@users.noreply.github.com>2019-09-06 12:36:45 -0600
commit14f9662f9cc0f93e88d5efbbaf10de79070bea93 (patch)
tree060655e7cc8369f6572df607d99d5f912f475d0f /modules/caddyhttp/fileserver/staticfiles.go
parent21d7b662e76feeb506cae9a616d92d85326566bd (diff)
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
Diffstat (limited to 'modules/caddyhttp/fileserver/staticfiles.go')
-rw-r--r--modules/caddyhttp/fileserver/staticfiles.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/modules/caddyhttp/fileserver/staticfiles.go b/modules/caddyhttp/fileserver/staticfiles.go
index cdac453..cfb79f8 100644
--- a/modules/caddyhttp/fileserver/staticfiles.go
+++ b/modules/caddyhttp/fileserver/staticfiles.go
@@ -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
}