mirror of
https://github.com/containers/podman
synced 2024-10-19 16:54:07 +00:00
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>
This commit is contained in:
parent
1d15ed708f
commit
2c31f38399
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue