summaryrefslogtreecommitdiff
path: root/neocities
diff options
context:
space:
mode:
authorEkaitz Zarraga <ekaitz@elenq.tech>2023-10-01 00:07:24 +0200
committerEkaitz Zarraga <ekaitz@elenq.tech>2023-10-02 21:48:41 +0200
commitf44f833de3c74c8111fd87a0997441339db80a82 (patch)
tree58f9e02a54d9893cfee7e93979cd11cf0bc39602 /neocities
parent178ced05f04d3fcabf0837b3bf133c20d0d9b986 (diff)
requests: fix [] insertion in querystring
Diffstat (limited to 'neocities')
-rw-r--r--neocities/api.scm2
-rw-r--r--neocities/requests.scm10
2 files changed, 6 insertions, 6 deletions
diff --git a/neocities/api.scm b/neocities/api.scm
index 83f2afe..a0788e7 100644
--- a/neocities/api.scm
+++ b/neocities/api.scm
@@ -79,7 +79,7 @@
(let ((url (neocities-url "delete"
#:port (neocities-api-port api)
#:hostname (neocities-api-hostname api)
- #:querystring `(("files" . ,files)))))
+ #:querystring `(("filenames[]" . ,files)))))
(neocities-request
'POST
url
diff --git a/neocities/requests.scm b/neocities/requests.scm
index 3f06a47..265ebcd 100644
--- a/neocities/requests.scm
+++ b/neocities/requests.scm
@@ -50,14 +50,14 @@
(string-join
(map (lambda (x)
(let ((key (car x))
- (value (cadr x)))
- (if (list? value)
+ (value (cdr x)))
+ (if (= 1 (length value))
+ (string-append (uri-encode key) "=" (uri-encode (car value)))
(string-join
(map (lambda (y)
- (string-append (uri-encode key) "[]=" (uri-encode y)))
+ (string-append (uri-encode key) "=" (uri-encode y)))
value)
- "&")
- (string-append (uri-encode key) "=" (uri-encode value)))))
+ "&"))))
querystring)
"&"))