diff options
author | Alexander_Kabui | 2024-08-07 17:51:47 +0300 |
---|---|---|
committer | Munyoki Kilyungi | 2024-08-09 11:55:16 +0300 |
commit | 44615cd691f854a882ba8fc4cff216718793d56d (patch) | |
tree | a76f609f0f02f3afd2abe1f37c4024cfb071ee15 /web/webserver.scm | |
parent | 8052d004e4065e39d2ddd4a6e9dcc03f2fbee5bb (diff) | |
download | gn-guile-44615cd691f854a882ba8fc4cff216718793d56d.tar.gz |
Replace string-append with format.
Diffstat (limited to 'web/webserver.scm')
-rwxr-xr-x | web/webserver.scm | 13 |
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))))))) |