Skip to content
Browse files
Fix JSON middleware to recognize Content-Type that specifies a charse…
…t (e.g. "application/json; charset=UTF-8")
  • Loading branch information
olivermg committed Oct 19, 2013
1 parent 0609fbf commit eee4482
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
@@ -6,3 +6,6 @@

# editor backup/temp files
@@ -23,7 +23,10 @@

(defmethod call ((this <clack-middleware-json>) env)
(when (string-equal (getf env :content-type) "application/json")
(when (= (search "application/json"
(getf env :content-type)
:test #'equalp)
(setf (getf env :body-parameters)
(list :json (yason:parse (ensure-character-input-stream
(getf env :raw-body))))))

0 comments on commit eee4482

Please sign in to comment.