diff options
author | Christopher Baines <mail@cbaines.net> | 2019-10-18 17:23:59 +0100 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2019-10-18 17:23:59 +0100 |
commit | 263eb0e0a9ab8cd877b8b1723a884b3c306fd012 (patch) | |
tree | 8809ae173a10210803bd3105d50dbee7f14ed90c | |
parent | c9e0e311bbee6dd85f017dbf5704492df72c2e9a (diff) | |
download | data-service-263eb0e0a9ab8cd877b8b1723a884b3c306fd012.tar data-service-263eb0e0a9ab8cd877b8b1723a884b3c306fd012.tar.gz |
Handle unknown requests better within controllers
-rw-r--r-- | guix-data-service/web/compare/controller.scm | 3 | ||||
-rw-r--r-- | guix-data-service/web/controller.scm | 11 | ||||
-rw-r--r-- | guix-data-service/web/jobs/controller.scm | 3 | ||||
-rw-r--r-- | guix-data-service/web/repository/controller.scm | 3 | ||||
-rw-r--r-- | guix-data-service/web/revision/controller.scm | 3 |
5 files changed, 14 insertions, 9 deletions
diff --git a/guix-data-service/web/compare/controller.scm b/guix-data-service/web/compare/controller.scm index 7c75767..d2af55f 100644 --- a/guix-data-service/web/compare/controller.scm +++ b/guix-data-service/web/compare/controller.scm @@ -114,7 +114,8 @@ (target_commit ,(parse-commit conn) #:required))))) (render-compare/packages mime-types conn - parsed-query-parameters))))) + parsed-query-parameters))) + (_ #f))) (define (render-compare mime-types conn diff --git a/guix-data-service/web/controller.scm b/guix-data-service/web/controller.scm index b5df73b..27b195c 100644 --- a/guix-data-service/web/controller.scm +++ b/guix-data-service/web/controller.scm @@ -202,11 +202,12 @@ (uri-path (request-uri request))) (define (delegate-to f) - (f request - method-and-path-components - mime-types - body - conn)) + (or (f request + method-and-path-components + mime-types + body + conn) + (not-found (request-uri request)))) (match method-and-path-components (('GET) diff --git a/guix-data-service/web/jobs/controller.scm b/guix-data-service/web/jobs/controller.scm index 8367196..eac2a58 100644 --- a/guix-data-service/web/jobs/controller.scm +++ b/guix-data-service/web/jobs/controller.scm @@ -44,7 +44,8 @@ (render-job mime-types conn job-id - parsed-query-parameters))))) + parsed-query-parameters))) + (_ #f))) (define (render-jobs mime-types conn) (render-html diff --git a/guix-data-service/web/repository/controller.scm b/guix-data-service/web/repository/controller.scm index 7ed147c..b3d2586 100644 --- a/guix-data-service/web/repository/controller.scm +++ b/guix-data-service/web/repository/controller.scm @@ -207,4 +207,5 @@ "/latest-processed-revision")) (render-unknown-revision mime-types conn - commit-hash)))))) + commit-hash)))) + (_ #f))) diff --git a/guix-data-service/web/revision/controller.scm b/guix-data-service/web/revision/controller.scm index fdd2dc3..56575b3 100644 --- a/guix-data-service/web/revision/controller.scm +++ b/guix-data-service/web/revision/controller.scm @@ -136,7 +136,8 @@ #:path-base path)) (render-unknown-revision mime-types conn - commit-hash))))) + commit-hash))) + (_ #f))) (define (texinfo->variants-alist s) (let ((stexi (texi-fragment->stexi s))) |