gw api: require at least one group on runs query api

This commit is contained in:
Simone Gotti 2019-04-03 08:52:29 +02:00
parent e2bc2043d0
commit 6736f5aebc
1 changed files with 7 additions and 1 deletions

View File

@ -299,8 +299,14 @@ func (h *RunsHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
q := r.URL.Query()
phaseFilter := q["phase"]
groups := q["group"]
// we require that groups are specified to not return all runs
if len(groups) == 0 {
http.Error(w, "not groups specified", http.StatusBadRequest)
return
}
phaseFilter := q["phase"]
changeGroups := q["changegroup"]
_, lastRun := q["lastrun"]