@marcel91200 / caddy Mirror · read-only / commits / 21408212
Fork 0

Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS

Mirrored from https://github.com/Slazee/caddy.git

Synced Nov 14, 05:15 UTC

http: query and query_string placeholders should use RawQuery, probably

Matthew Holt committed Dec 17, 2019 at 16:29 UTC 21408212dafc1b37e2f2d51a4c4afbcc9cef403b
1 file changed +2 -6
modules/caddyhttp/replacer.go
+2 -6
@@ -105,7 +105,7 @@ func addHTTPVarsToReplacer(repl caddy.Replacer, req *http.Request, w http.Respon
105 case "http.request.uri.query":
106 return req.URL.RawQuery, true
107 case "http.request.uri.query_string":
108 - return "?" + req.URL.Query().Encode(), true
108 + return "?" + req.URL.RawQuery, true
109
110 // original request, before any internal changes
111 case "http.request.orig_method":
@@ -130,11 +130,7 @@ func addHTTPVarsToReplacer(repl caddy.Replacer, req *http.Request, w http.Respon
130 return or.URL.RawQuery, true
131 case "http.request.orig_uri.query_string":
132 or, _ := req.Context().Value(OriginalRequestCtxKey).(http.Request)
133 - qs := or.URL.Query().Encode()
134 - if qs != "" {
135 - qs = "?" + qs
136 - }
137 - return qs, true
133 + return "?" + or.URL.RawQuery, true
134 }
135
136 // hostname labels