Skip to content

Commit

Permalink
Disables HTML encoding for JSON responses (#80)
Browse files Browse the repository at this point in the history
  • Loading branch information
ArturoSerrano authored and winnab committed Sep 11, 2019
1 parent 0595f91 commit 7f17218
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions handlers/api_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand Down

0 comments on commit 7f17218

Please sign in to comment.