diff options
author | Matt Holt <[email protected]> | 2022-09-05 13:53:41 -0600 |
---|---|---|
committer | GitHub <[email protected]> | 2022-09-05 13:53:41 -0600 |
commit | d5ea43fb4b549dda6040b31ce472e7843dfc5077 (patch) | |
tree | 9c73b4dfde8fb0f2ee487d1ce0441bb59ab914be /modules/caddyhttp/replacer.go | |
parent | ca4fae64d99a63291a91e59af5a1e8eef8c8e2d8 (diff) | |
download | caddy-d5ea43fb4b549dda6040b31ce472e7843dfc5077.tar.gz caddy-d5ea43fb4b549dda6040b31ce472e7843dfc5077.zip |
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.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/modules/caddyhttp/replacer.go b/modules/caddyhttp/replacer.go index 17fc02eaf..e15464997 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": |