mirror of
https://github.com/labstack/echo.git
synced 2025-01-16 02:33:26 +02:00
fix getting miltiple query params
This commit is contained in:
parent
0d2dac7532
commit
7fee34fade
@ -30,8 +30,11 @@ func (u *URL) QueryParam(name string) string {
|
|||||||
func (u *URL) QueryParams() (params map[string][]string) {
|
func (u *URL) QueryParams() (params map[string][]string) {
|
||||||
params = make(map[string][]string)
|
params = make(map[string][]string)
|
||||||
u.QueryArgs().VisitAll(func(k, v []byte) {
|
u.QueryArgs().VisitAll(func(k, v []byte) {
|
||||||
// TODO: Filling with only first value
|
_, ok := params[string(k)]
|
||||||
params[string(k)] = []string{string(v)}
|
if !ok {
|
||||||
|
params[string(k)] = make([]string, 0)
|
||||||
|
}
|
||||||
|
params[string(k)] = append(params[string(k)], string(v))
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user