|
|
@@ -322,7 +322,9 @@ func (b *Builder) GinReq(ctx context.Context, g *gin.Context, req *http.Request)
|
|
|
|
if ctxVal := g.GetString("reqid"); ctxVal != "" {
|
|
|
|
if ctxVal := g.GetString("reqid"); ctxVal != "" {
|
|
|
|
b.Str("gin.context.reqid", ctxVal)
|
|
|
|
b.Str("gin.context.reqid", ctxVal)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if req.Method != "GET" && req.Body != nil && req.Header.Get("Content-Type") == "application/json" {
|
|
|
|
if req.Method != "GET" && req.Body != nil {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if req.Header.Get("Content-Type") == "application/json" {
|
|
|
|
if brc, ok := req.Body.(dataext.BufferedReadCloser); ok {
|
|
|
|
if brc, ok := req.Body.(dataext.BufferedReadCloser); ok {
|
|
|
|
if bin, err := brc.BufferedAll(); err == nil {
|
|
|
|
if bin, err := brc.BufferedAll(); err == nil {
|
|
|
|
if len(bin) < 16*1024 {
|
|
|
|
if len(bin) < 16*1024 {
|
|
|
@@ -334,12 +336,26 @@ func (b *Builder) GinReq(ctx context.Context, g *gin.Context, req *http.Request)
|
|
|
|
b.Bytes("gin.body", bin)
|
|
|
|
b.Bytes("gin.body", bin)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
b.Str("gin.body", fmt.Sprintf("[[%v bytes]]", len(bin)))
|
|
|
|
b.Str("gin.body", fmt.Sprintf("[[%v bytes | %s]]", len(bin), req.Header.Get("Content-Type")))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if req.Header.Get("Content-Type") == "multipart/form-data" || req.Header.Get("Content-Type") == "x-www-form-urlencoded" {
|
|
|
|
|
|
|
|
if brc, ok := req.Body.(dataext.BufferedReadCloser); ok {
|
|
|
|
|
|
|
|
if bin, err := brc.BufferedAll(); err == nil {
|
|
|
|
|
|
|
|
if len(bin) < 16*1024 {
|
|
|
|
|
|
|
|
b.Bytes("gin.body", bin)
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
b.Str("gin.body", fmt.Sprintf("[[%v bytes | %s]]", len(bin), req.Header.Get("Content-Type")))
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
b.containsGinData = true
|
|
|
|
b.containsGinData = true
|
|
|
|
return b
|
|
|
|
return b
|
|
|
|
}
|
|
|
|
}
|
|
|
|