From 6ec261e7acaf58f6172d7bdeaadebb0da738cfa8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20Sj=C3=B6lund?= Date: Mon, 10 Jul 2023 19:08:11 +0200 Subject: [PATCH] Add missing return after utils.InternalServerError() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Erik Sjölund --- pkg/api/handlers/libpod/pods.go | 1 + test/apiv2/40-pods.at | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/pkg/api/handlers/libpod/pods.go b/pkg/api/handlers/libpod/pods.go index c13af63136..43b789b8f9 100644 --- a/pkg/api/handlers/libpod/pods.go +++ b/pkg/api/handlers/libpod/pods.go @@ -547,6 +547,7 @@ func PodStats(w http.ResponseWriter, r *http.Request) { options := entities.PodStatsOptions{All: query.All} if err := entities.ValidatePodStatsOptions(query.NamesOrIDs, &options); err != nil { utils.InternalServerError(w, err) + return } var flush = func() {} diff --git a/test/apiv2/40-pods.at b/test/apiv2/40-pods.at index 0e0f1cb18c..f54adeb185 100644 --- a/test/apiv2/40-pods.at +++ b/test/apiv2/40-pods.at @@ -103,6 +103,10 @@ t GET libpod/pods/stats?namesOrIDs=fakename 404 \ .cause="no such pod" \ .message="unable to get list of pods: no pod with name or ID fakename found: no such pod" +t GET "libpod/pods/stats?all=true&namesOrIDs=foo" 500 \ + .cause="--all, --latest and arguments cannot be used together" \ + .message="--all, --latest and arguments cannot be used together" + t DELETE libpod/pods/bar?force=true 200 # test the fake name