|
@@ -3,7 +3,6 @@ package proto
|
|
|
import (
|
|
|
"bufio"
|
|
|
"bytes"
|
|
|
- metrics "github.com/rcrowley/go-metrics"
|
|
|
"io"
|
|
|
"io/ioutil"
|
|
|
"net"
|
|
@@ -15,6 +14,8 @@ import (
|
|
|
"strings"
|
|
|
"sync"
|
|
|
"time"
|
|
|
+
|
|
|
+ metrics "github.com/rcrowley/go-metrics"
|
|
|
)
|
|
|
|
|
|
type HttpRequest struct {
|
|
@@ -93,7 +94,12 @@ func (h *Http) readRequests(tee *conn.Tee, lastTxn chan *HttpTxn, connCtx interf
|
|
|
|
|
|
txn := &HttpTxn{Start: time.Now(), ConnUserCtx: connCtx}
|
|
|
txn.Req = &HttpRequest{Request: req}
|
|
|
- txn.Req.BodyBytes, txn.Req.Body, err = extractBody(req.Body)
|
|
|
+ if req.Body != nil {
|
|
|
+ txn.Req.BodyBytes, txn.Req.Body, err = extractBody(req.Body)
|
|
|
+ if err != nil {
|
|
|
+ tee.Warn("Failed to extract request body: %v", err)
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
lastTxn <- txn
|
|
|
h.Txns.In() <- txn
|