summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--worker.go13
1 files changed, 12 insertions, 1 deletions
diff --git a/worker.go b/worker.go
index 88737f7..2d7d3ad 100644
--- a/worker.go
+++ b/worker.go
@@ -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