Skip to content

Commit

Permalink
add comment about legacy text/plain content type
Browse files Browse the repository at this point in the history
Signed-off-by: Dmitry S <[email protected]>
  • Loading branch information
dmitris committed Mar 5, 2024
1 parent 07dfaaf commit a3c9e36
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions endpoints/openrtb2/amp_auction.go
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,10 @@ func sendAmpResponse(
// Fixes #231
enc := json.NewEncoder(w)
enc.SetEscapeHTML(false)
// Explicitly set content type to text/plain, which had previously been
// the implied behavior from the time the project was launched.
// It's unclear why text/plain was chosen or if it was an oversight,
// nevertheless we will keep it as such for compatibility reasons.
w.Header().Set("Content-Type", "text/plain; charset=utf-8")

// If an error happens when encoding the response, there isn't much we can do.
Expand Down

0 comments on commit a3c9e36

Please sign in to comment.