aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2020-06-29 01:08:11 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2020-06-29 01:08:54 +0200
commitc36b4fc8c4f1a1d43bbd66867c36a1c25a74d455 (patch)
treecbb622a53e800f8d40e3e991952481f792625e7e
parentFix type for components created from xcal. (diff)
downloadcalp-c36b4fc8c4f1a1d43bbd66867c36a1c25a74d455.tar.gz
calp-c36b4fc8c4f1a1d43bbd66867c36a1c25a74d455.tar.xz
Allow multiple equals in HTTP queries.
-rw-r--r--module/server/util.scm8
1 files changed, 6 insertions, 2 deletions
diff --git a/module/server/util.scm b/module/server/util.scm
index b9bc6099..f6110952 100644
--- a/module/server/util.scm
+++ b/module/server/util.scm
@@ -5,6 +5,10 @@
(define-public (parse-query query)
(when query
(fold (lambda (str list)
- (let* (((k v) (string-split str #\=)))
- (cons* (-> k string->symbol symbol->keyword) v list)))
+ ;; only split on the first equal.
+ ;; Does HTTP allow multiple equal signs in a data field?
+ (define idx (string-index str #\=))
+ (define key (substring str 0 idx))
+ (define val (substring str (1+ idx)))
+ (cons* (-> key string->symbol symbol->keyword) val list))
'() (string-split query #\&))))