summaryrefslogtreecommitdiff
path: root/modules/caddyhttp/fileserver/caddyfile.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/caddyfile.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/caddyfile.go')
-rw-r--r--modules/caddyhttp/fileserver/caddyfile.go8
1 files changed, 1 insertions, 7 deletions
diff --git a/modules/caddyhttp/fileserver/caddyfile.go b/modules/caddyhttp/fileserver/caddyfile.go
index 7afcc9e..4622af2 100644
--- a/modules/caddyhttp/fileserver/caddyfile.go
+++ b/modules/caddyhttp/fileserver/caddyfile.go
@@ -17,9 +17,9 @@ package fileserver
import (
"encoding/json"
- "github.com/caddyserver/caddy/v2/modules/caddyhttp/rewrite"
"github.com/caddyserver/caddy/v2/caddyconfig/httpcaddyfile"
"github.com/caddyserver/caddy/v2/modules/caddyhttp"
+ "github.com/caddyserver/caddy/v2/modules/caddyhttp/rewrite"
)
func init() {
@@ -71,11 +71,6 @@ func parseCaddyfile(h httpcaddyfile.Helper) (caddyhttp.MiddlewareHandler, error)
}
}
- // if no root was configured explicitly, use site root
- if fsrv.Root == "" {
- fsrv.Root = "{http.var.root}"
- }
-
// hide the Caddyfile (and any imported Caddyfiles)
if configFiles := h.Caddyfiles(); len(configFiles) > 0 {
for _, file := range configFiles {
@@ -104,7 +99,6 @@ func parseTryFiles(h httpcaddyfile.Helper) ([]httpcaddyfile.ConfigValue, error)
matcherSet := map[string]json.RawMessage{
"file": h.JSON(MatchFile{
- Root: "{http.var.root}",
TryFiles: try,
}, nil),
}