File tree Expand file tree Collapse file tree 2 files changed +9
-7
lines changed
instrumentation/play-2.6/src/main/java/datadog/trace/instrumentation/play26/appsec
testing/src/main/groovy/datadog/trace/agent/test/base Expand file tree Collapse file tree 2 files changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -97,10 +97,10 @@ static void before(
9797 throw new BlockingException ("Blocked request (for StatusHeader/sendJson)" );
9898 }
9999 }
100- }
101100
102- @ Advice .OnMethodExit (suppress = Throwable .class , onThrowable = Throwable .class )
103- static void after () {
104- CallDepthThreadLocalMap .decrementCallDepth (StatusHeader .class );
101+ @ Advice .OnMethodExit (suppress = Throwable .class , onThrowable = Throwable .class )
102+ static void after () {
103+ CallDepthThreadLocalMap .decrementCallDepth (StatusHeader .class );
104+ }
105105 }
106106}
Original file line number Diff line number Diff line change @@ -2384,6 +2384,7 @@ abstract class HttpServerTest<SERVER> extends WithHttpServer<SERVER> {
23842384 boolean bodyConvertedBlock
23852385 boolean responseHeadersInTags
23862386 boolean responseBodyTag
2387+ Object responseBody
23872388 }
23882389
23892390 static final String stringOrEmpty (String string ) {
@@ -2399,6 +2400,9 @@ abstract class HttpServerTest<SERVER> extends WithHttpServer<SERVER> {
23992400 final BiFunction<RequestContext , IGSpanInfo , Flow<Void > > requestEndedCb =
24002401 ({ RequestContext rqCtxt , IGSpanInfo info ->
24012402 Context context = rqCtxt. getData(RequestContextSlot . APPSEC )
2403+ if (context. responseBodyTag) {
2404+ rqCtxt. traceSegment. setTagTop(' response.body' , context. responseBody)
2405+ }
24022406 if (context. extraSpanName) {
24032407 runUnderTrace(context. extraSpanName, false ) {
24042408 def span = activeSpan()
@@ -2547,9 +2551,7 @@ abstract class HttpServerTest<SERVER> extends WithHttpServer<SERVER> {
25472551 body = obj. toString()
25482552 }
25492553 Context context = rqCtxt. getData(RequestContextSlot . APPSEC )
2550- if (context. responseBodyTag) {
2551- rqCtxt. traceSegment. setTagTop(' response.body' , body)
2552- }
2554+ context. responseBody = body
25532555 if (context. responseBlock) {
25542556 new RbaFlow (
25552557 new Flow.Action.RequestBlockingAction (413 , BlockingContentType . JSON )
You can’t perform that action at this time.
0 commit comments