From 09ebe83f3707ff9b87febddf6c7be36aee3cf008 Mon Sep 17 00:00:00 2001 From: Pierre Neidhardt Date: Fri, 23 Sep 2022 13:31:33 +0200 Subject: [PATCH] Allow reporting multiple results. For instance when adding a directory with multiple files. --- main.lisp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/main.lisp b/main.lisp index 4514367..00bd8ea 100644 --- a/main.lisp +++ b/main.lisp @@ -48,8 +48,10 @@ (let* ((result (cond ((stringp body) body) ((vectorp body) (flexi-streams:octets-to-string body)))) (result (if (search "application/json" (cdr (assoc :content-type headers))) - (unless (empty-string-p result) - (simplify (yason:parse result :object-as :alist))) + (mapcar (lambda (line) + (simplify (yason:parse line :object-as :alist))) + (delete "" (uiop:split-string result :separator (string #\newline)) + :test 'string=)) result))) (if (eql 200 status-code) result