Skip to content

Commit

Permalink
fix for turn nil body into non nil body
Browse files Browse the repository at this point in the history
  • Loading branch information
aayush-ap committed Nov 20, 2023
1 parent 0e521dc commit c44684b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion v3/newrelic/transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ func serverName(r *http.Request) string {
}

func reqBody(req *http.Request) *BodyBuffer {
if IsSecurityAgentPresent() {
if IsSecurityAgentPresent() && req.Body != nil && req.Body != http.NoBody {
buf := &BodyBuffer{buf: make([]byte, 0, 100)}
tee := io.TeeReader(req.Body, buf)
req.Body = io.NopCloser(tee)
Expand Down

0 comments on commit c44684b

Please sign in to comment.