aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2022-10-16 22:13:42 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2022-10-16 23:28:34 +0200
commitff006c12c12026e7b48e799cc389e178229493bd (patch)
treebcdd18d523128c016b07d6b1e0f1f293ca259d14
parentTruncate print for spawned repl. (diff)
downloadcalp-ff006c12c12026e7b48e799cc389e178229493bd.tar.gz
calp-ff006c12c12026e7b48e799cc389e178229493bd.tar.xz
Add missing lambda in make routes.
-rw-r--r--module/web/http/make-routes.scm39
1 files changed, 20 insertions, 19 deletions
diff --git a/module/web/http/make-routes.scm b/module/web/http/make-routes.scm
index 0a8b4afe..feba3f19 100644
--- a/module/web/http/make-routes.scm
+++ b/module/web/http/make-routes.scm
@@ -150,26 +150,27 @@
(current-error-port))
(call-with-values
- (call/ec (lambda (return)
- (apply
- (with-throw-handler #t
- (lambda ()
- (cond #,@(map (generate-case routes-regexes #'r:method #'r:path) routes)
- (else (lambda* _ (return (build-response code: 404)
- "404 Not Fonud")))))
- #,(assoc-ref options with-throw-handler:))
- (append
- (parse-query r:query)
+ (lambda ()
+ (call/ec (lambda (return)
+ (apply
+ (with-throw-handler #t
+ (lambda ()
+ (cond #,@(map (generate-case routes-regexes #'r:method #'r:path) routes)
+ (else (lambda* _ (return (build-response code: 404)
+ "404 Not Fonud")))))
+ #,(assoc-ref options with-throw-handler:))
+ (append
+ (parse-query r:query)
- ;; When content-type is application/x-www-form-urlencoded,
- ;; decode them, and add it to the argument list
- (let ((content-type (assoc-ref r:headers 'content-type)))
- (when content-type
- (let ((type args (car+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))))))))))
+ ;; When content-type is application/x-www-form-urlencoded,
+ ;; decode them, and add it to the argument list
+ (let ((content-type (assoc-ref r:headers 'content-type)))
+ (when content-type
+ (let ((type args (car+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)))))))))))
(case-lambda ((headers body new-state) (values headers body new-state))
((headers body) (values headers body state))