Skip to content

Commit

Permalink
fix: do not close empty request body (#87)
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Gianelloni <wolf31o2@blinklabs.io>
  • Loading branch information
wolf31o2 authored Mar 20, 2024
1 parent b03c193 commit d70f648
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,10 @@ func handleSubmitTx(c *gin.Context) {
c.String(500, "failed to request body")
return
}
if err := c.Request.Body.Close(); err != nil {
logger.Errorf("failed to close request body: %s", err)
if c.Request.Body != nil {
if err := c.Request.Body.Close(); err != nil {
logger.Errorf("failed to close request body: %s", err)
}
}
logger.Debugf("transaction dump: %x", rawTx)
// Determine transaction type (era)
Expand Down

0 comments on commit d70f648

Please sign in to comment.