diff options
author | Ekaitz Zarraga <ekaitz@elenq.tech> | 2023-10-01 00:07:24 +0200 |
---|---|---|
committer | Ekaitz Zarraga <ekaitz@elenq.tech> | 2023-10-02 21:48:41 +0200 |
commit | f44f833de3c74c8111fd87a0997441339db80a82 (patch) | |
tree | 58f9e02a54d9893cfee7e93979cd11cf0bc39602 /neocities | |
parent | 178ced05f04d3fcabf0837b3bf133c20d0d9b986 (diff) |
requests: fix [] insertion in querystring
Diffstat (limited to 'neocities')
-rw-r--r-- | neocities/api.scm | 2 | ||||
-rw-r--r-- | neocities/requests.scm | 10 |
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) "&")) |