http: Handle wrong build number on log route.

* src/cuirass/http.scm (url-handler): Handle erroneous id -> number conversion
on "/build/id/log/raw" route.
This commit is contained in:
Mathieu Othacehe 2020-08-02 18:34:19 +02:00
parent ce89a40ed8
commit 59c974134f
No known key found for this signature in database
GPG Key ID: 8354763531769CA6
1 changed files with 2 additions and 1 deletions

View File

@ -374,7 +374,8 @@ Hydra format."
(#:link . ,(string-append "/jobset/" (assq-ref build #:specification)))))))
(respond-build-not-found build-id))))
(('GET "build" build-id "log" "raw")
(let ((build (db-get-build (string->number build-id))))
(let* ((id (string->number build-id))
(build (and id (db-get-build id))))
(if build
(match (assq-ref build #:outputs)
(((_ (#:path . (? string? output))) _ ...)