X-Git-Url: http://git.kpe.io/?p=cl-modlisp.git;a=blobdiff_plain;f=utils.lisp;h=bab76c36b97e199c4b35e941c7ad54da85c53949;hp=d6ebf831788766697f2aa46881173593377c6cc6;hb=HEAD;hpb=5e8a673f84b1bf72d7bbcb28c1565b1d22e19a30 diff --git a/utils.lisp b/utils.lisp index d6ebf83..bab76c3 100644 --- a/utils.lisp +++ b/utils.lisp @@ -18,7 +18,7 @@ (:xml "text/xml") (:text "text/plain") (otherwise fmt))) - + (defun format-string (fmt headers) `(("Content-Type" . ,(format->string fmt)) @@ -42,7 +42,7 @@ ,result)))) (defmacro with-ml-page ((&key (format :html) (precompute t) headers) - &body body) + &body body) (if precompute `(output-ml-page ,format (with-output-to-string (*modlisp-socket*) ,@body) :headers ,headers) `(write-response (:headers (format-string ,format ,headers)) ,@body))) @@ -71,13 +71,13 @@ (when posted-string (let ((alist '())) (dolist (name=val (kmrcl:delimited-string-to-list posted-string #\&) - (nreverse alist)) - (let ((name-val-list (kmrcl:delimited-string-to-list name=val #\=))) - (if (= 2 (length name-val-list)) - (destructuring-bind (name val) name-val-list - (push (cons (if keyword - (kmrcl:ensure-keyword name) - name) - (kmrcl:decode-uri-query-string val)) - alist)) - (cmsg-c :debug "Invalid number of #\= in ~S" name-val-list))))))) + (nreverse alist)) + (let ((name-val-list (kmrcl:delimited-string-to-list name=val #\=))) + (if (= 2 (length name-val-list)) + (destructuring-bind (name val) name-val-list + (push (cons (if keyword + (kmrcl:ensure-keyword name) + name) + (kmrcl:decode-uri-query-string val)) + alist)) + (cmsg-c :debug "Invalid number of #\= in ~S" name-val-list)))))))