From 7f172186ad595abc9112809fc728d307c29cb2a7 Mon Sep 17 00:00:00 2001 From: Arturo Serrano Cuza Date: Wed, 11 Sep 2019 07:18:43 -0400 Subject: [PATCH] Disables HTML encoding for JSON responses (#80) --- handlers/api_handler.go | 1 + 1 file changed, 1 insertion(+) diff --git a/handlers/api_handler.go b/handlers/api_handler.go index a0cddb0a..607827bf 100644 --- a/handlers/api_handler.go +++ b/handlers/api_handler.go @@ -42,6 +42,7 @@ func (h APIHandler) respond(w http.ResponseWriter, status int, response interfac w.WriteHeader(status) encoder := json.NewEncoder(w) + encoder.SetEscapeHTML(false) err := encoder.Encode(response) if err != nil { h.logger.Error("encoding response", err, lager.Data{"status": status, "response": response})