Commit 593715fbdf8a7427166da05512aedd32ac5935d5

Thomas de Grivel 2018-06-05T18:54:44

let header accept str parts

diff --git a/thot.lisp b/thot.lisp
index 670fad6..820387d 100644
--- a/thot.lisp
+++ b/thot.lisp
@@ -307,20 +307,21 @@
     (stream-write-sequence stream line)
     (stream-write-sequence stream +crlf+)))
 
-(defun header (line)
+(defun header (&rest parts)
   (unless (reply-status)
     (status "200 OK"))
-  (let ((headers (reply-headers)))
+  (let ((line (str parts))
+        (headers (reply-headers)))
     (if (endp headers)
         (setf (reply-headers) (list line))
         (loop
            (when (endp (rest headers))
              (setf (rest headers) (list line))
              (return))
-           (pop headers))))
-  (let ((stream (reply-stream)))
-    (stream-write-sequence stream line)
-    (stream-write-sequence stream +crlf+)))
+           (pop headers)))
+    (let ((stream (reply-stream)))
+      (stream-write-sequence stream line)
+      (stream-write-sequence stream +crlf+))))
 
 (defun end-headers ()
   (unless (reply-headers-sent)