guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

branch master updated: http: Handle wrong build number on details route.


From: Mathieu Othacehe
Subject: branch master updated: http: Handle wrong build number on details route.
Date: Sun, 02 Aug 2020 12:33:06 -0400

This is an automated email from the git hooks/post-receive script.

mothacehe pushed a commit to branch master
in repository guix-cuirass.

The following commit(s) were added to refs/heads/master by this push:
     new ce89a40  http: Handle wrong build number on details route.
ce89a40 is described below

commit ce89a40ed8e8c32cd080e642c715591bb891474a
Author: Mathieu Othacehe <othacehe@gnu.org>
AuthorDate: Sun Aug 2 18:30:37 2020 +0200

    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.
---
 src/cuirass/http.scm | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/cuirass/http.scm b/src/cuirass/http.scm
index fdcdc06..4c1d954 100644
--- a/src/cuirass/http.scm
+++ b/src/cuirass/http.scm
@@ -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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]