Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(890)

Unified Diff: milo/appengine/buildbot/html.go

Issue 2364653002: Buildbot build json grpc endpoint (Closed)
Patch Set: Pass tests Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « milo/appengine/buildbot/grpc.go ('k') | milo/appengine/buildbot/html_data.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: milo/appengine/buildbot/html.go
diff --git a/milo/appengine/buildbot/html.go b/milo/appengine/buildbot/html.go
index d37de96f4b271eeb35757766b8ac4cfb73c139d5..6d9e24418341a5635223aaa04039c2ae0d9a97bc 100644
--- a/milo/appengine/buildbot/html.go
+++ b/milo/appengine/buildbot/html.go
@@ -8,6 +8,7 @@ import (
"fmt"
"net/http"
"os"
+ "strconv"
"github.com/julienschmidt/httprouter"
"golang.org/x/net/context"
@@ -51,8 +52,15 @@ func (b Build) Render(c context.Context, r *http.Request, p httprouter.Params) (
Code: http.StatusBadRequest,
}
}
+ num, err := strconv.Atoi(buildNum)
+ if err != nil {
+ return nil, &miloerror.Error{
+ Message: fmt.Sprintf("%s does not look like a number", buildNum),
+ Code: http.StatusBadRequest,
+ }
+ }
- result, err := build(c, master, builder, buildNum)
+ result, err := build(c, master, builder, num)
if err != nil {
return nil, err
}
« no previous file with comments | « milo/appengine/buildbot/grpc.go ('k') | milo/appengine/buildbot/html_data.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698