diff options
author | Matthew Holt <[email protected]> | 2019-08-27 14:38:24 -0600 |
---|---|---|
committer | Matthew Holt <[email protected]> | 2019-08-27 14:38:24 -0600 |
commit | d242f10eda8fdd52f86701cf3685090e9761489f (patch) | |
tree | 1b13f2f3e8dbc09f2a697a40b5e99f481039a13d /modules/caddyhttp/replacer.go | |
parent | 2dc4fcc62bfab639b60758f26659c03e58af9960 (diff) | |
download | caddy-d242f10eda8fdd52f86701cf3685090e9761489f.tar.gz caddy-d242f10eda8fdd52f86701cf3685090e9761489f.zip |
Add query_string to HTTP replacer and use it for try_files
Diffstat (limited to 'modules/caddyhttp/replacer.go')
-rw-r--r-- | modules/caddyhttp/replacer.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/modules/caddyhttp/replacer.go b/modules/caddyhttp/replacer.go index cc29789b0..9a8a875e5 100644 --- a/modules/caddyhttp/replacer.go +++ b/modules/caddyhttp/replacer.go @@ -89,6 +89,12 @@ func addHTTPVarsToReplacer(repl caddy.Replacer, req *http.Request, w http.Respon return dir, true case "http.request.uri.query": return req.URL.RawQuery, true + case "http.request.uri.query_string": + qs := req.URL.Query().Encode() + if qs != "" { + qs = "?" + qs + } + return qs, true } // hostname labels |