[ ] I have looked at the documentation here first?
[ ] I have looked at the examples provided that may showcase my question here?
Package version eg. v9, v10:
v10
Issue, Question or Enhancement:
The GetFormValues() method in the rest/https/util.go file is unable to obtain array parameters due to r.Form. Get(name) will force the first value of the array parameter to be returned, and can only be a string. This method should be changed to
r. Form["name"]
Code sample, to showcase or reproduce:
① error code
func GetFormValues(r *http.Request) (map[string]any, error) {
if err := r.ParseForm(); err != nil {
return nil, err
}
if err := r.ParseMultipartForm(maxMemory); err != nil {
if err != http.ErrNotMultipart {
return nil, err
}
}
params := make(map[string]any, len(r.Form))
for name := range r.Form {
formValue := r.Form.Get(name)
if len(formValue) > 0 {
params[name] = formValue
}
}
return params, nil
}
right code
func GetFormValues(r *http.Request) (map[string]any, error) {
if err := r.ParseForm(); err != nil {
return nil, err
}
if err := r.ParseMultipartForm(maxMemory); err != nil {
if err != http.ErrNotMultipart {
return nil, err
}
}
params := make(map[string]any, len(r.Form))
for name := range r.Form {
if len( r.Form[name]) > 1 {
params[name] = r.Form[name]
}else{
formValue := r.Form.Get(name)
if len(formValue) >0 {
params[name] = formValue
}
}
}
return params, nil
}
Package version eg. v9, v10:
v10
Issue, Question or Enhancement:
The GetFormValues() method in the rest/https/util.go file is unable to obtain array parameters due to r.Form. Get(name) will force the first value of the array parameter to be returned, and can only be a string. This method should be changed to
r. Form["name"]
Code sample, to showcase or reproduce:
① error code
right code