mirror of
https://github.com/caddyserver/caddy.git
synced 2024-12-26 21:53:48 +03:00
Add path components to HTTP replacer
This commit is contained in:
parent
d25008d2c8
commit
6dfba5fda8
1 changed files with 6 additions and 0 deletions
|
@ -79,6 +79,12 @@ func addHTTPVarsToReplacer(repl caddy.Replacer, req *http.Request, w http.Respon
|
|||
key := fmt.Sprintf("http.request.host.labels.%d", len(hostLabels)-i-1)
|
||||
m[key] = label
|
||||
}
|
||||
|
||||
pathParts := strings.Split(req.URL.Path, "/")
|
||||
for i, label := range pathParts {
|
||||
key := fmt.Sprintf("http.request.uri.path.%d", i)
|
||||
m[key] = label
|
||||
}
|
||||
}
|
||||
|
||||
if w != nil {
|
||||
|
|
Loading…
Reference in a new issue