Bugfix on QueryPlus function

face-detect
Noah Petherbridge 2023-11-06 21:47:08 -07:00
parent fae995e486
commit ebd63bcb0d
1 changed files with 5 additions and 1 deletions

View File

@ -188,7 +188,11 @@ func UrlEncode(values ...interface{}) string {
func QueryPlus(r *http.Request) func(...interface{}) template.URL {
return func(upsert ...interface{}) template.URL {
// Get current parameters.
var params = r.Form
// Note: COPY them from r.Form so we don't accidentally modify r.Form.
var params = map[string][]string{}
for k, v := range r.Form {
params[k] = v
}
// Mix in the incoming fields.
for i := 0; i < len(upsert); i += 2 {