We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ac883f9 commit 87d3556Copy full SHA for 87d3556
README.md
@@ -72,10 +72,10 @@ import (
72
)
73
74
// JSON marshals v to JSON, automatically escaping HTML,
75
-// setting the Content-Type header as application/json,
+// setting the Content-Type header as "application/json; charset=utf-8",
76
// sends an HTTP response header with the provided statusCode and
77
// writes the marshaled v as bytes to the connection as part of an HTTP reply.
78
-func JSON(w http.ResponseWriter, v any, statusCode int) {
+func JSON(w http.ResponseWriter, statusCode int, v any) {
79
var buf bytes.Buffer
80
enc := json.NewEncoder(&buf)
81
enc.SetEscapeHTML(true)
0 commit comments