This commit is contained in:
seydx
2025-05-26 22:21:33 +02:00
parent bf45f64a7e
commit 7c17e64090
2 changed files with 14 additions and 14 deletions
+3 -3
View File
@@ -167,17 +167,17 @@ func ResponseJSON(w http.ResponseWriter, v any) {
func ResponsePrettyJSON(w http.ResponseWriter, v any) {
w.Header().Set("Content-Type", "application/json")
var buf bytes.Buffer
enc := json.NewEncoder(&buf)
enc.SetIndent("", " ")
err := enc.Encode(v)
if err != nil {
http.Error(w, "Internal Server Error", http.StatusInternalServerError)
return
}
redactedJSON := shell.Redact(buf.String())
w.Write([]byte(redactedJSON))
}