mirror of
https://github.com/vale981/lack
synced 2025-03-05 09:21:39 -05:00
Allow 'content' of types other than alist in lack.test:generate-env.
This commit is contained in:
parent
17756b63fd
commit
4fac568329
1 changed files with 10 additions and 4 deletions
|
@ -33,7 +33,7 @@
|
||||||
|
|
||||||
;; default headers
|
;; default headers
|
||||||
(setf headers (append `(("host" . ,host) ("accept" . "*/*")) headers))
|
(setf headers (append `(("host" . ,host) ("accept" . "*/*")) headers))
|
||||||
|
|
||||||
(when content
|
(when content
|
||||||
(let ((content-type (or (cdr (assoc "content-type" headers :test #'string-equal))
|
(let ((content-type (or (cdr (assoc "content-type" headers :test #'string-equal))
|
||||||
(if (find-if #'pathnamep content :key #'cdr)
|
(if (find-if #'pathnamep content :key #'cdr)
|
||||||
|
@ -50,9 +50,15 @@
|
||||||
(format s "~A=~A" (caar cookies) (cdar cookies))
|
(format s "~A=~A" (caar cookies) (cdar cookies))
|
||||||
(loop for (k . v) in (cdr cookies)
|
(loop for (k . v) in (cdr cookies)
|
||||||
do (format s "; ~A=~A" k v))))))))
|
do (format s "; ~A=~A" k v))))))))
|
||||||
(when content
|
(setf content
|
||||||
(setf content (flex:string-to-octets
|
(etypecase content
|
||||||
(quri:url-encode-params content))))
|
(cons (flex:string-to-octets
|
||||||
|
(quri:url-encode-params content)
|
||||||
|
:external-format :utf-8))
|
||||||
|
(string (flex:string-to-octets content
|
||||||
|
:external-format :utf-8))
|
||||||
|
(array content)
|
||||||
|
(null nil)))
|
||||||
(list :request-method method
|
(list :request-method method
|
||||||
;; Seems that all Clack handlers put into this field
|
;; Seems that all Clack handlers put into this field
|
||||||
;; only pathname with GET parameters
|
;; only pathname with GET parameters
|
||||||
|
|
Loading…
Add table
Reference in a new issue