aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2018-03-01 15:40:19 +0100
committerLudovic Courtès <ludo@gnu.org>2018-03-01 15:40:19 +0100
commit5ddd4b97a50a0faaf70509b37d8e104f4504be09 (patch)
treee2742a9a4b5640bd393dd46a8ae9cde5ccffe9df /src
parentdbea9790d30ff1c2e80585e9441d45ed0b740e30 (diff)
downloadcuirass-5ddd4b97a50a0faaf70509b37d8e104f4504be09.tar
cuirass-5ddd4b97a50a0faaf70509b37d8e104f4504be09.tar.gz
http: 'request-parameters' always returns a list.
* src/cuirass/http.scm (request-parameters): Return the empty list when QUERY is #f.
Diffstat (limited to 'src')
-rw-r--r--src/cuirass/http.scm23
1 files changed, 12 insertions, 11 deletions
diff --git a/src/cuirass/http.scm b/src/cuirass/http.scm
index 59e4ce1..0548184 100644
--- a/src/cuirass/http.scm
+++ b/src/cuirass/http.scm
@@ -79,17 +79,18 @@
'((parameter value) ...)."
(let* ((uri (request-uri request))
(query (uri-query uri)))
- (and query
- (map (lambda (param)
- (match (string-split param #\=)
- ((key param)
- (let ((key-symbol (string->symbol key)))
- (list key-symbol
- (match key-symbol
- ('id (string->number param))
- ('nr (string->number param))
- (_ param)))))))
- (string-split query #\&)))))
+ (if query
+ (map (lambda (param)
+ (match (string-split param #\=)
+ ((key param)
+ (let ((key-symbol (string->symbol key)))
+ (list key-symbol
+ (match key-symbol
+ ('id (string->number param))
+ ('nr (string->number param))
+ (_ param)))))))
+ (string-split query #\&))
+ '())))
;;;