aboutsummaryrefslogtreecommitdiff
path: root/web/webserver.scm
diff options
context:
space:
mode:
Diffstat (limited to 'web/webserver.scm')
-rwxr-xr-xweb/webserver.scm13
1 files changed, 6 insertions, 7 deletions
diff --git a/web/webserver.scm b/web/webserver.scm
index 2dab5b1..3cfcf50 100755
--- a/web/webserver.scm
+++ b/web/webserver.scm
@@ -137,11 +137,6 @@ otherwise search for set/group data"
(lambda (port)
(scm->json json port))))
-(define (decode-query query)
- (if (not query)
- '()
- (map decode-query-component (string-split query #\&))))
-
(define (decode-request-json body)
(if (not body)
'()
@@ -157,10 +152,14 @@ otherwise search for set/group data"
(define (edit-file-handler repo request)
(catch 'file-error
(lambda ()
- (let* ((params (decode-query (uri-query (request-uri request)))) (query-path (assoc-ref params 'file_path)))
+ (let* ((query (uri-query (request-uri request)))
+ (params (if (not query)
+ '()
+ (map decode-query-component (string-split query #\&))))
+ (query-path (assoc-ref params 'file_path)))
(if query-path
(build-json-response 400 (fetch-file repo query-path))
- (throw 'file-error (string-append "Please provide a valid file path in the query")))))
+ (throw 'file-error "Please provide a valid file path in the query"))))
(lambda (key . args)
(let ((msg (car args))) (build-json-response 400 `(("error" . ,key) ("msg" . ,msg)))))))