From fb04413bfce4f910509ba0cce60dea124b0f1a16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Sun, 9 Aug 2020 10:17:29 +0200 Subject: =?UTF-8?q?Can=20create=20events=20with=20=C3=A5=C3=A4=C3=B6=20aga?= =?UTF-8?q?in.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- module/server/macro.scm | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'module/server/macro.scm') diff --git a/module/server/macro.scm b/module/server/macro.scm index ba70a484..99272a75 100644 --- a/module/server/macro.scm +++ b/module/server/macro.scm @@ -87,8 +87,13 @@ (append (parse-query r:query) - (when (memv 'application/x-www-form-urlencoded - (or (assoc-ref r:headers 'content-type) '())) - (parse-query (uri-decode (bytevector->string body "UTF-8"))))))))) + (let ((content-type (assoc-ref r:headers 'content-type))) + (when content-type + (let ((type (car content-type)) + (args (cdr content-type))) + (when (eq? type 'application/x-www-form-urlencoded) + (let ((encoding (or (assoc-ref args 'encoding) "UTF-8"))) + (parse-query (bytevector->string body encoding) + encoding))))))))))) (lambda* (a b #:optional new-state) (values a b (or new-state state)))))))) -- cgit v1.2.3