summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-07-27 15:10:27 +0200
committerGitHub <noreply@github.com>2020-07-27 15:10:27 +0200
commit55a7faf2b8f09034064029887cc85811a7dae582 (patch)
tree89989ac3f8102dad905dd6a648167fc89e71eea2
parent71f7150490c622708ade8348dcd85fd428c5f116 (diff)
parent724a09e40ef2830ec730e7d3f0c729d31b030399 (diff)
downloadpodman-55a7faf2b8f09034064029887cc85811a7dae582.tar.gz
podman-55a7faf2b8f09034064029887cc85811a7dae582.tar.bz2
podman-55a7faf2b8f09034064029887cc85811a7dae582.zip
Merge pull request #7088 from vrothberg/fix-7078
API events: fix parsing error
-rw-r--r--pkg/api/handlers/compat/events.go8
-rw-r--r--test/apiv2/01-basic.at4
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