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)
|
key := fmt.Sprintf("http.request.host.labels.%d", len(hostLabels)-i-1)
|
||||||
m[key] = label
|
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 {
|
if w != nil {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue