http: Handle wrong build number on details route.
The request "/build/2465370mdb%22fx'ggx/details" causes a select query on the whole Builds table, because failed "string->number" conversion is not handled. * src/cuirass/http.scm (url-handler): Handle erroneous id -> number conversion on "/build/id/details" route.
This commit is contained in:
parent
769682924c
commit
ce89a40ed8
|
@ -363,8 +363,9 @@ Hydra format."
|
|||
(respond-json (object->json-string hydra-build))
|
||||
(respond-build-not-found id))))
|
||||
(('GET "build" build-id "details")
|
||||
(let ((build (db-get-build (string->number build-id)))
|
||||
(products (db-get-build-products build-id)))
|
||||
(let* ((id (string->number build-id))
|
||||
(build (and id (db-get-build id)))
|
||||
(products (and build (db-get-build-products build-id))))
|
||||
(if build
|
||||
(respond-html
|
||||
(html-page (string-append "Build " build-id)
|
||||
|
|
Loading…
Reference in New Issue