X-Git-Url: http://git.kpe.io/?p=cl-modlisp.git;a=blobdiff_plain;f=utils.lisp;fp=utils.lisp;h=d6ebf831788766697f2aa46881173593377c6cc6;hp=2f3a2139186f2398291f568f01d12a34f3141731;hb=5e8a673f84b1bf72d7bbcb28c1565b1d22e19a30;hpb=bba0c14661b34e447456e397fc98fefebec5c4f8 diff --git a/utils.lisp b/utils.lisp index 2f3a213..d6ebf83 100644 --- a/utils.lisp +++ b/utils.lisp @@ -12,13 +12,16 @@ (in-package #:modlisp) +(defun format->string (fmt) + (case fmt + (:html "text/html") + (:xml "text/xml") + (:text "text/plain") + (otherwise fmt))) + (defun format-string (fmt headers) `(("Content-Type" . - ,(case fmt - (:html "text/html") - (:xml "text/xml") - (:text "text/plain") - (otherwise fmt))) + ,(format->string fmt)) . ,headers)) (defmacro write-response ((&key headers len (status "200 OK")) &body body)