mirror of
https://github.com/containers/podman.git
synced 2025-06-27 05:26:50 +08:00
Merge pull request #7088 from vrothberg/fix-7078
API events: fix parsing error
This commit is contained in:
@ -29,8 +29,14 @@ func filtersFromRequest(r *http.Request) ([]string, error) {
|
|||||||
compatFilters map[string]map[string]bool
|
compatFilters map[string]map[string]bool
|
||||||
filters map[string][]string
|
filters map[string][]string
|
||||||
libpodFilters []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.
|
// Backwards compat with older versions of Docker.
|
||||||
if err := json.Unmarshal(raw, &compatFilters); err == nil {
|
if err := json.Unmarshal(raw, &compatFilters); err == nil {
|
||||||
|
@ -68,4 +68,8 @@ else
|
|||||||
_show_ok 0 "Time for ten /info requests" "<= 5 seconds" "$delta_t seconds"
|
_show_ok 0 "Time for ten /info requests" "<= 5 seconds" "$delta_t seconds"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Simple events test (see #7078)
|
||||||
|
t GET "events?stream=false" 200
|
||||||
|
t GET "libpod/events?stream=false" 200
|
||||||
|
|
||||||
# vim: filetype=sh
|
# vim: filetype=sh
|
||||||
|
Reference in New Issue
Block a user