mirror of
https://github.com/caddyserver/caddy.git
synced 2024-12-27 06:03:48 +03:00
http: query and query_string placeholders should use RawQuery, probably
This commit is contained in:
parent
fe516575db
commit
21408212da
1 changed files with 2 additions and 6 deletions
|
@ -105,7 +105,7 @@ func addHTTPVarsToReplacer(repl caddy.Replacer, req *http.Request, w http.Respon
|
||||||
case "http.request.uri.query":
|
case "http.request.uri.query":
|
||||||
return req.URL.RawQuery, true
|
return req.URL.RawQuery, true
|
||||||
case "http.request.uri.query_string":
|
case "http.request.uri.query_string":
|
||||||
return "?" + req.URL.Query().Encode(), true
|
return "?" + req.URL.RawQuery, true
|
||||||
|
|
||||||
// original request, before any internal changes
|
// original request, before any internal changes
|
||||||
case "http.request.orig_method":
|
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
|
return or.URL.RawQuery, true
|
||||||
case "http.request.orig_uri.query_string":
|
case "http.request.orig_uri.query_string":
|
||||||
or, _ := req.Context().Value(OriginalRequestCtxKey).(http.Request)
|
or, _ := req.Context().Value(OriginalRequestCtxKey).(http.Request)
|
||||||
qs := or.URL.Query().Encode()
|
return "?" + or.URL.RawQuery, true
|
||||||
if qs != "" {
|
|
||||||
qs = "?" + qs
|
|
||||||
}
|
|
||||||
return qs, true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// hostname labels
|
// hostname labels
|
||||||
|
|
Loading…
Reference in a new issue