diff options
author | Matthew Holt <[email protected]> | 2019-12-17 16:29:37 -0700 |
---|---|---|
committer | Matthew Holt <[email protected]> | 2019-12-17 16:29:37 -0700 |
commit | 21408212dafc1b37e2f2d51a4c4afbcc9cef403b (patch) | |
tree | f9595b064feb6b6d40d5fde194df958a1d708ef5 /modules/caddyhttp/replacer.go | |
parent | fe516575db3da5c0b9eba74b07066ecc22d90ba4 (diff) | |
download | caddy-21408212dafc1b37e2f2d51a4c4afbcc9cef403b.tar.gz caddy-21408212dafc1b37e2f2d51a4c4afbcc9cef403b.zip |
http: query and query_string placeholders should use RawQuery, probably
Diffstat (limited to 'modules/caddyhttp/replacer.go')
-rw-r--r-- | modules/caddyhttp/replacer.go | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/modules/caddyhttp/replacer.go b/modules/caddyhttp/replacer.go index b806fdc9e..c8fae796e 100644 --- a/modules/caddyhttp/replacer.go +++ b/modules/caddyhttp/replacer.go @@ -105,7 +105,7 @@ func addHTTPVarsToReplacer(repl caddy.Replacer, req *http.Request, w http.Respon case "http.request.uri.query": return req.URL.RawQuery, true case "http.request.uri.query_string": - return "?" + req.URL.Query().Encode(), true + return "?" + req.URL.RawQuery, true // original request, before any internal changes case "http.request.orig_method": @@ -130,11 +130,7 @@ func addHTTPVarsToReplacer(repl caddy.Replacer, req *http.Request, w http.Respon return or.URL.RawQuery, true case "http.request.orig_uri.query_string": or, _ := req.Context().Value(OriginalRequestCtxKey).(http.Request) - qs := or.URL.Query().Encode() - if qs != "" { - qs = "?" + qs - } - return qs, true + return "?" + or.URL.RawQuery, true } // hostname labels |