Bugfix on QueryPlus function
This commit is contained in:
parent
fae995e486
commit
ebd63bcb0d
|
@ -188,7 +188,11 @@ func UrlEncode(values ...interface{}) string {
|
||||||
func QueryPlus(r *http.Request) func(...interface{}) template.URL {
|
func QueryPlus(r *http.Request) func(...interface{}) template.URL {
|
||||||
return func(upsert ...interface{}) template.URL {
|
return func(upsert ...interface{}) template.URL {
|
||||||
// Get current parameters.
|
// 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.
|
// Mix in the incoming fields.
|
||||||
for i := 0; i < len(upsert); i += 2 {
|
for i := 0; i < len(upsert); i += 2 {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user