Skip to content

Commit

Permalink
Catch or explicitly ignore unhandled errors
Browse files Browse the repository at this point in the history
  • Loading branch information
geofffranks authored and ameowlia committed Sep 23, 2024
1 parent bacc132 commit 8fff0e9
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions handlers/cf_handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ func WriteJSONResponse(w http.ResponseWriter, statusCode int, jsonObj interface{
w.Header().Set("Content-Length", strconv.Itoa(len(jsonBytes)))
w.Header().Set("Content-Type", "application/json")
w.WriteHeader(statusCode)
// #nosec G104 - Ignore errors writing HTTP response, to avoid spamming logs in the event of a DoS
w.Write(jsonBytes)
}

Expand Down

0 comments on commit 8fff0e9

Please sign in to comment.