Merge pull request #27060 from yongtang/27021-inspect-show-env
Disable HTML escaping for JSON strings in `docker inspect` Upstream-commit: 420e22fad4dcdff3b8025666216cc85fc9358f69 Component: engine
This commit is contained in:
@ -81,7 +81,9 @@ func ParseForm(r *http.Request) error {
|
||||
func WriteJSON(w http.ResponseWriter, code int, v interface{}) error {
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
w.WriteHeader(code)
|
||||
return json.NewEncoder(w).Encode(v)
|
||||
enc := json.NewEncoder(w)
|
||||
enc.SetEscapeHTML(false)
|
||||
return enc.Encode(v)
|
||||
}
|
||||
|
||||
// VersionFromContext returns an API version from the context using APIVersionKey.
|
||||
|
||||
Reference in New Issue
Block a user