Browse Source
http: query and query_string placeholders should use RawQuery, probably
master
Matthew Holt
6 years ago
No known key found for this signature in database
GPG Key ID: 2A349DD577D586A5
1 changed files with
2 additions and
6 deletions
-
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
|
|
|
|