Add path components to HTTP replacer

This commit is contained in:
Matthew Holt 2019-07-08 16:46:55 -06:00
parent d25008d2c8
commit 6dfba5fda8
No known key found for this signature in database
GPG key ID: 2A349DD577D586A5

View file

@ -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 {