Skip to content

Commit

Permalink
server: Add indent to server responses to make it human readable
Browse files Browse the repository at this point in the history
Signed-off-by: Heathcliff <[email protected]>
  • Loading branch information
heathcliff26 committed Aug 10, 2024
1 parent a7bcfbb commit 6c1cded
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/server/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func ReadUserIP(req *http.Request) string {

// Send a response to the writer and handle impossible parse errors
func sendResponse(rw http.ResponseWriter, res any) {
b, err := json.Marshal(res)
b, err := json.MarshalIndent(res, "", " ")
if err != nil {
slog.Error("Failed to create Response", "err", err)
return
Expand Down

0 comments on commit 6c1cded

Please sign in to comment.