Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Julio Guerra <julio@datadog.com>
  • Loading branch information
Hellzy and Julio-Guerra committed Feb 24, 2022
1 parent 7716114 commit 927399e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions contrib/gin-gonic/gin/appsec.go
Expand Up @@ -27,8 +27,8 @@ func useAppSec(c *gin.Context, span tracer.Span) func() {
}
}
args := httpsec.MakeHandlerOperationArgs(req, params)
ctx, op := httpsec.StartOperation(c.Request.Context(), args)
*req = *req.WithContext(ctx)
ctx, op := httpsec.StartOperation(req.Context(), args)
c.Request = req.WithContext(ctx)
return func() {
events := op.Finish(httpsec.HandlerOperationRes{Status: c.Writer.Status()})
if len(events) > 0 {
Expand Down
2 changes: 1 addition & 1 deletion contrib/labstack/echo.v4/appsec.go
Expand Up @@ -28,7 +28,7 @@ func withAppSec(next echo.HandlerFunc) echo.HandlerFunc {
}
args := httpsec.MakeHandlerOperationArgs(req, params)
ctx, op := httpsec.StartOperation(req.Context(), args)
*req = *req.WithContext(ctx)
c.SetRequest(req.WithContext(ctx))
defer func() {
events := op.Finish(httpsec.HandlerOperationRes{Status: c.Response().Status})
if len(events) > 0 {
Expand Down

0 comments on commit 927399e

Please sign in to comment.