Skip to content

Commit

Permalink
Merge pull request #7089 from vrothberg/2.0-fix-7078
Browse files Browse the repository at this point in the history
[2.0] events parsing fix #7078
  • Loading branch information
openshift-merge-robot authored Jul 27, 2020
2 parents 9352c34 + e2cb457 commit eea6bd1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pkg/api/handlers/compat/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 4 additions & 0 deletions test/apiv2/01-basic.at
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit eea6bd1

Please sign in to comment.