diff options
Diffstat (limited to 'worker.go')
| -rw-r--r-- | worker.go | 13 |
1 files changed, 12 insertions, 1 deletions
@@ -99,6 +99,13 @@ func (w *Worker) Start(argv []string, module map[string]any) error { // Listen starts a goroutine listening/handling HTTP requests from the queue. func (w *Worker) Listen(queue chan any) { + stringListToAny := func(slice []string) []any { + res := []any{} + for _, v := range slice { + res = append(res, v) + } + return res + } handle := func() { defer w.lua.RestoreStackFunc()() r := <- queue @@ -130,7 +137,11 @@ func (w *Worker) Listen(queue chan any) { flatQr := make(map[string]any) qr := r.request.URL.Query() for k := range qr { - flatQr[k] = qr.Get(k) + if len(qr[k]) > 1 { + flatQr[k] = stringListToAny(qr[k]) + } else { + flatQr[k] = qr.Get(k) + } } res["query"] = flatQr |
