summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--HACKING2
-rw-r--r--neocities/requests.scm6
-rw-r--r--tests/requests.scm4
3 files changed, 7 insertions, 5 deletions
diff --git a/HACKING b/HACKING
index bf84f41..97f6256 100644
--- a/HACKING
+++ b/HACKING
@@ -39,6 +39,8 @@ dependencies manually:
- pkg-config
- texinfo
- guile-hall
+ - guile-json
+ - guile-gcrypt
Once those dependencies are installed you can run:
diff --git a/neocities/requests.scm b/neocities/requests.scm
index d0270c2..20d328d 100644
--- a/neocities/requests.scm
+++ b/neocities/requests.scm
@@ -51,13 +51,13 @@
(map (lambda (x)
(let ((key (car x))
(value (cdr x)))
- (if (= 1 (length value))
- (string-append (uri-encode key) "=" (uri-encode (car value)))
+ (if (list? value)
(string-join
(map (lambda (y)
(string-append (uri-encode key) "=" (uri-encode y)))
value)
- "&"))))
+ "&")
+ (string-append (uri-encode key) "=" (uri-encode value)))))
querystring)
"&"))
diff --git a/tests/requests.scm b/tests/requests.scm
index 15cee77..727a886 100644
--- a/tests/requests.scm
+++ b/tests/requests.scm
@@ -55,10 +55,10 @@
(test-group "Encodes array in querystring"
(define url (neocities-url
"info" #:hostname "neocities.org" #:port 80
- #:querystring '(("file" . ("COSA CON ESPACIOS" "otra cosa")))))
+ #:querystring '(("file[]" . ("COSA CON ESPACIOS" "otra cosa")))))
(test-assert (string=?
(uri-query url)
- "file[]=COSA%20CON%20ESPACIOS&file[]=otra%20cosa")))
+ "file%5B%5D=COSA%20CON%20ESPACIOS&file%5B%5D=otra%20cosa")))
(test-end "URL")