summaryrefslogtreecommitdiff
path: root/modules/caddyhttp/replacer.go
diff options
context:
space:
mode:
authorMatt Holt <mholt@users.noreply.github.com>2022-09-05 13:53:41 -0600
committerGitHub <noreply@github.com>2022-09-05 13:53:41 -0600
commitd5ea43fb4b549dda6040b31ce472e7843dfc5077 (patch)
tree9c73b4dfde8fb0f2ee487d1ce0441bb59ab914be /modules/caddyhttp/replacer.go
parentca4fae64d99a63291a91e59af5a1e8eef8c8e2d8 (diff)
fileserver: Support glob expansion in file matcher (#4993)
* fileserver: Support glob expansion in file matcher * Fix tests * Fix bugs and tests * Attempt Windows fix, sigh * debug Windows, WIP * Continue debugging Windows * Another attempt at Windows * Plz Windows * Cmon... * Clean up, hope I didn't break anything
Diffstat (limited to 'modules/caddyhttp/replacer.go')
-rw-r--r--modules/caddyhttp/replacer.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/modules/caddyhttp/replacer.go b/modules/caddyhttp/replacer.go
index 17fc02e..e154649 100644
--- a/modules/caddyhttp/replacer.go
+++ b/modules/caddyhttp/replacer.go
@@ -143,6 +143,10 @@ func addHTTPVarsToReplacer(repl *caddy.Replacer, req *http.Request, w http.Respo
case "http.request.uri.path.dir":
dir, _ := path.Split(req.URL.Path)
return dir, true
+ case "http.request.uri.path.file.base":
+ return strings.TrimSuffix(path.Base(req.URL.Path), path.Ext(req.URL.Path)), true
+ case "http.request.uri.path.file.ext":
+ return path.Ext(req.URL.Path), true
case "http.request.uri.query":
return req.URL.RawQuery, true
case "http.request.duration":