summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2019-05-16 22:43:51 +0100
committerChristopher Baines <mail@cbaines.net>2019-05-16 22:43:51 +0100
commitdfb1da3197cf9d839754400794ecd651dfdcd52c (patch)
tree0c2c81b44ffb0c133f3145bb8237f00e46a20c97
parent83012b101b2a900d1bccfcb8ed9deab2aa002e9a (diff)
downloaddata-service-dfb1da3197cf9d839754400794ecd651dfdcd52c.tar
data-service-dfb1da3197cf9d839754400794ecd651dfdcd52c.tar.gz
Fix query-parameters->string for multi-valued parameters
-rw-r--r--guix-data-service/web/query-parameters.scm15
1 files changed, 8 insertions, 7 deletions
diff --git a/guix-data-service/web/query-parameters.scm b/guix-data-service/web/query-parameters.scm
index 7445409..dbf2e65 100644
--- a/guix-data-service/web/query-parameters.scm
+++ b/guix-data-service/web/query-parameters.scm
@@ -172,13 +172,14 @@
((key . ($ <invalid-query-parameter>))
'())
((key . value)
- (list (simple-format #f "~A=~A"
- key (value->text value))))
- ((key values ...)
- (map (lambda (value)
- (simple-format #f "~A=~A"
- key (value->text value)))
- values)))
+ (if (list? value)
+ (map (lambda (value)
+ (simple-format #f "~A=~A"
+ key (value->text value)))
+ value)
+ (list (simple-format
+ #f "~A=~A"
+ key (value->text value))))))
query-parameters))
"&"))