mirror of
https://github.com/caddyserver/caddy.git
synced 2025-05-31 04:05:46 -04:00
Add path components to HTTP replacer
This commit is contained in:
parent
d25008d2c8
commit
6dfba5fda8
@ -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…
x
Reference in New Issue
Block a user