Skip to content

Commit

Permalink
Send 400 status code on error reading request body
Browse files Browse the repository at this point in the history
  • Loading branch information
hbhoyar-uber committed Dec 27, 2023
1 parent acba541 commit 2133364
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion runtime/server_http_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -798,7 +798,7 @@ func (req *ServerHTTPRequest) ReadAll() ([]byte, bool) {
if err != nil {
req.contextLogger.ErrorZ(req.Context(), "Could not read request body", zap.Error(err))
if !req.parseFailed {
req.res.SendError(500, "Could not read request body", err)
req.res.SendError(400, "Could not read request body", err)
req.parseFailed = true
}
return nil, false
Expand Down

0 comments on commit 2133364

Please sign in to comment.