diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-07-27 19:02:34 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-27 19:02:34 +0200 |
commit | eea6bd1cf45746e754e2cceb76f8eb638bcad718 (patch) | |
tree | cbd3ae4c3b57c6c82b166578a3e73635bb9582ab | |
parent | 9352c342d62bbf3b49b0d4d67e8704cbbcd212cd (diff) | |
parent | e2cb457e5fc1e45c84f380b5240b8cd5e9f76ce6 (diff) | |
download | podman-eea6bd1cf45746e754e2cceb76f8eb638bcad718.tar.gz podman-eea6bd1cf45746e754e2cceb76f8eb638bcad718.tar.bz2 podman-eea6bd1cf45746e754e2cceb76f8eb638bcad718.zip |
Merge pull request #7089 from vrothberg/2.0-fix-7078
[2.0] events parsing fix #7078
-rw-r--r-- | pkg/api/handlers/compat/events.go | 8 | ||||
-rw-r--r-- | test/apiv2/01-basic.at | 4 |
2 files changed, 11 insertions, 1 deletions
diff --git a/pkg/api/handlers/compat/events.go b/pkg/api/handlers/compat/events.go index 9d5cb5045..8c4ad575b 100644 --- a/pkg/api/handlers/compat/events.go +++ b/pkg/api/handlers/compat/events.go @@ -29,8 +29,14 @@ func filtersFromRequest(r *http.Request) ([]string, error) { compatFilters map[string]map[string]bool filters map[string][]string libpodFilters []string + raw []byte ) - raw := []byte(r.Form.Get("filters")) + + if _, found := r.URL.Query()["filters"]; found { + raw = []byte(r.Form.Get("filters")) + } else { + return []string{}, nil + } // Backwards compat with older versions of Docker. if err := json.Unmarshal(raw, &compatFilters); err == nil { diff --git a/test/apiv2/01-basic.at b/test/apiv2/01-basic.at index 18ec9bbe8..79dac990a 100644 --- a/test/apiv2/01-basic.at +++ b/test/apiv2/01-basic.at @@ -68,4 +68,8 @@ else _show_ok 0 "Time for ten /info requests" "<= 5 seconds" "$delta_t seconds" fi +# Simple events test (see #7078) +t GET "events?stream=false" 200 +t GET "libpod/events?stream=false" 200 + # vim: filetype=sh |