mirror of
https://github.com/containers/podman.git
synced 2025-06-20 09:03:43 +08:00
Merge pull request #14662 from Luap99/api-json
API: containers/json always set application/json content type
This commit is contained in:
@ -115,10 +115,6 @@ func ListContainers(w http.ResponseWriter, r *http.Request) {
|
|||||||
utils.InternalServerError(w, err)
|
utils.InternalServerError(w, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if len(pss) == 0 {
|
|
||||||
utils.WriteResponse(w, http.StatusOK, "[]")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
utils.WriteResponse(w, http.StatusOK, pss)
|
utils.WriteResponse(w, http.StatusOK, pss)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,7 +16,12 @@ podman pull $ENV_WORKDIR_IMG &>/dev/null
|
|||||||
# Ensure clean slate
|
# Ensure clean slate
|
||||||
podman rm -a -f &>/dev/null
|
podman rm -a -f &>/dev/null
|
||||||
|
|
||||||
t GET "libpod/containers/json (at start: clean slate)" 200 length=0
|
t GET "libpod/containers/json (at start: clean slate)" 200 \
|
||||||
|
"[]" \
|
||||||
|
length=0
|
||||||
|
# check content type: https://github.com/containers/podman/issues/14647
|
||||||
|
response_headers=$(cat "$WORKDIR/curl.headers.out")
|
||||||
|
like "$response_headers" ".*Content-Type: application/json.*" "header does not contain application/json"
|
||||||
|
|
||||||
# Regression test for #12904 (race condition in logging code)
|
# Regression test for #12904 (race condition in logging code)
|
||||||
mytext="hi-there-$(random_string 15)"
|
mytext="hi-there-$(random_string 15)"
|
||||||
|
Reference in New Issue
Block a user