Add default headers to ENV generate-env returns.

This commit is contained in:
Eitaro Fukamachi 2015-03-24 15:41:25 +09:00
parent 07fb0fc836
commit d6815bb8ff

View file

@ -15,6 +15,8 @@
(in-package :lack.test)
(defun generate-env (uri &key (method :get) content headers cookies)
;; default headers
(setf headers (append '(("host" . "localhost") ("accept" . "*/*")) headers))
(when content
(let ((content-type (or (cdr (assoc "content-type" headers :test #'string-equal))
(if (find-if #'pathnamep content :key #'cdr)