summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikolay Edigaryev <edigaryev@gmail.com>2021-02-12 23:02:58 +0300
committerNikolay Edigaryev <edigaryev@gmail.com>2021-02-12 23:55:12 +0300
commit2c31f383990c7288d63bec13a5a421e09a9386f0 (patch)
treec081632607dfbe83ad5eb12e4fcc81f8d93db0a7
parent1d15ed708f2d7c6dab5ee90415acb156973ac1a4 (diff)
downloadpodman-2c31f383990c7288d63bec13a5a421e09a9386f0.tar.gz
podman-2c31f383990c7288d63bec13a5a421e09a9386f0.tar.bz2
podman-2c31f383990c7288d63bec13a5a421e09a9386f0.zip
Fix superfluous response.WriteHeader call in WaitContainerLibpod()
When the query decoding fails at the beginning of WaitContainerLibpod(), the Error() sets the header but doesn't returns after that. This causes the execution flow to reach the WriteResponse() at the end of WaitContainerLibpod(), which attempts to set another header, thus causing the following error: http: superfluous response.WriteHeader call from github.com/containers/podman/pkg/api/handlers/utils.WriteResponse (handler.go:124) [NO TESTS NEEDED] Signed-off-by: Nikolay Edigaryev <edigaryev@gmail.com>
-rw-r--r--pkg/api/handlers/utils/containers.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/pkg/api/handlers/utils/containers.go b/pkg/api/handlers/utils/containers.go
index ba202cad0..e79def6f3 100644
--- a/pkg/api/handlers/utils/containers.go
+++ b/pkg/api/handlers/utils/containers.go
@@ -105,6 +105,7 @@ func WaitContainerLibpod(w http.ResponseWriter, r *http.Request) {
query := waitQueryLibpod{}
if err := decoder.Decode(&query, r.URL.Query()); err != nil {
Error(w, "Something went wrong.", http.StatusBadRequest, errors.Wrapf(err, "failed to parse parameters for %s", r.URL.String()))
+ return
}
if _, found := r.URL.Query()["interval"]; found {