diff options
author | Matthew Holt <mholt@users.noreply.github.com> | 2019-05-21 13:10:14 -0600 |
---|---|---|
committer | Matthew Holt <mholt@users.noreply.github.com> | 2019-05-21 13:10:14 -0600 |
commit | 67d32e6779b8e4f67fb0902b06210596371ead7f (patch) | |
tree | b5cf0490ba4d685d1af7c21e154c500a3426db45 /modules/caddyhttp/replacer.go | |
parent | 9d54f655aa7698ce683786dfc31b6f11df3c89d2 (diff) |
Fix up matchers tests and take care of TODO in rewrite
Diffstat (limited to 'modules/caddyhttp/replacer.go')
-rw-r--r-- | modules/caddyhttp/replacer.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/modules/caddyhttp/replacer.go b/modules/caddyhttp/replacer.go index 16cc1fe..0b0547d 100644 --- a/modules/caddyhttp/replacer.go +++ b/modules/caddyhttp/replacer.go @@ -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 { |