From bb5bd09eade239dda07332a887d0fafb6e29ee87 Mon Sep 17 00:00:00 2001 From: Paul Holzinger Date: Mon, 20 Jun 2022 14:03:05 +0200 Subject: API: containers/json always set application/json content type When we return no containers we just return `[]` but we still have to keep the content type header `application/json` so external tools can correctly parse the output. Fixes #14647 Signed-off-by: Paul Holzinger --- pkg/api/handlers/libpod/containers.go | 4 ---- 1 file changed, 4 deletions(-) (limited to 'pkg/api/handlers/libpod') diff --git a/pkg/api/handlers/libpod/containers.go b/pkg/api/handlers/libpod/containers.go index 6b5bee403..deddcaf93 100644 --- a/pkg/api/handlers/libpod/containers.go +++ b/pkg/api/handlers/libpod/containers.go @@ -115,10 +115,6 @@ func ListContainers(w http.ResponseWriter, r *http.Request) { utils.InternalServerError(w, err) return } - if len(pss) == 0 { - utils.WriteResponse(w, http.StatusOK, "[]") - return - } utils.WriteResponse(w, http.StatusOK, pss) } -- cgit v1.2.3-54-g00ecf