mirror of https://github.com/containers/podman.git
api: Don't HTML escape application/json responses
An HTTP response with Content-Type application/json does not need to be HTML escaped. Doing this causes encoding issues in the Podman REST API output as seen in the issue: Fixes #17769 Remove the HTML escaping from Content-Type: application/json responses. Signed-off-by: Stef Walter <stef@thewalter.net>
This commit is contained in:
parent
17a386a19d
commit
5a952362dd
|
@ -120,7 +120,7 @@ func WriteJSON(w http.ResponseWriter, code int, value interface{}) {
|
|||
w.WriteHeader(code)
|
||||
|
||||
coder := json.NewEncoder(w)
|
||||
coder.SetEscapeHTML(true)
|
||||
coder.SetEscapeHTML(false)
|
||||
if err := coder.Encode(value); err != nil {
|
||||
logrus.Errorf("Unable to write json: %q", err)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue