Permalink
Browse files

Fix JSON middleware to recognize Content-Type that specifies a charse…

…t (e.g. "application/json; charset=UTF-8")
  • Loading branch information...
1 parent 0609fbf commit eee448283c7148ca26327ac1cd3ac9d9111a2aba @olivermg olivermg committed Oct 19, 2013
Showing with 7 additions and 1 deletion.
  1. +3 −0 .gitignore
  2. +4 −1 src/core/middleware/json.lisp
View
@@ -6,3 +6,6 @@
*.x86f
*.fas
*.lib
+
+# 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)
+ 0)
(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.