Fix up matchers tests and take care of TODO in rewrite

This commit is contained in:
Matthew Holt 2019-05-21 13:10:14 -06:00
parent 9d54f655aa
commit 67d32e6779
3 changed files with 9 additions and 10 deletions

View file

@ -48,16 +48,17 @@ func addHTTPVarsToReplacer(repl caddy2.Replacer, req *http.Request, w http.Respo
dir, _ := path.Split(req.URL.Path)
return dir
}()
m["http.request.uri.query"] = req.URL.RawQuery
for param, vals := range req.URL.Query() {
m["http.request.uri.query."+param] = strings.Join(vals, ",")
}
for field, vals := range req.Header {
m["http.request.header."+strings.ToLower(field)] = strings.Join(vals, ",")
}
for _, cookie := range req.Cookies() {
m["http.request.cookie."+cookie.Name] = cookie.Value
}
for param, vals := range req.URL.Query() {
m["http.request.uri.query."+param] = strings.Join(vals, ",")
}
hostLabels := strings.Split(req.Host, ".")
for i, label := range hostLabels {