mirror of
https://github.com/vale981/lack
synced 2025-03-05 09:21:39 -05:00
Set body-parameters only when the parsed data is an alist.
This commit is contained in:
parent
4bd5dca97a
commit
2a9fc540cf
1 changed files with 4 additions and 2 deletions
|
@ -102,8 +102,10 @@
|
||||||
;; POST parameters
|
;; POST parameters
|
||||||
(when (and (null body-parameters)
|
(when (and (null body-parameters)
|
||||||
(request-has-body-p req))
|
(request-has-body-p req))
|
||||||
(setf body-parameters
|
(let ((parsed (http-body:parse content-type content-length raw-body)))
|
||||||
(http-body:parse content-type content-length raw-body))
|
(when (and (consp parsed)
|
||||||
|
(every #'consp parsed))
|
||||||
|
(setf body-parameters parsed)))
|
||||||
(file-position raw-body 0)
|
(file-position raw-body 0)
|
||||||
(setf (getf env :raw-body) raw-body)
|
(setf (getf env :raw-body) raw-body)
|
||||||
(rplacd (last env) (list :body-parameters body-parameters)))))
|
(rplacd (last env) (list :body-parameters body-parameters)))))
|
||||||
|
|
Loading…
Add table
Reference in a new issue