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(
97
97
throw new BlockingException ("Blocked request (for StatusHeader/sendJson)" );
98
98
}
99
99
}
100
- }
101
100
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
+ }
105
105
}
106
106
}
Original file line number Diff line number Diff line change @@ -2384,6 +2384,7 @@ abstract class HttpServerTest<SERVER> extends WithHttpServer<SERVER> {
2384
2384
boolean bodyConvertedBlock
2385
2385
boolean responseHeadersInTags
2386
2386
boolean responseBodyTag
2387
+ Object responseBody
2387
2388
}
2388
2389
2389
2390
static final String stringOrEmpty (String string ) {
@@ -2399,6 +2400,9 @@ abstract class HttpServerTest<SERVER> extends WithHttpServer<SERVER> {
2399
2400
final BiFunction<RequestContext , IGSpanInfo , Flow<Void > > requestEndedCb =
2400
2401
({ RequestContext rqCtxt , IGSpanInfo info ->
2401
2402
Context context = rqCtxt. getData(RequestContextSlot . APPSEC )
2403
+ if (context. responseBodyTag) {
2404
+ rqCtxt. traceSegment. setTagTop(' response.body' , context. responseBody)
2405
+ }
2402
2406
if (context. extraSpanName) {
2403
2407
runUnderTrace(context. extraSpanName, false ) {
2404
2408
def span = activeSpan()
@@ -2547,9 +2551,7 @@ abstract class HttpServerTest<SERVER> extends WithHttpServer<SERVER> {
2547
2551
body = obj. toString()
2548
2552
}
2549
2553
Context context = rqCtxt. getData(RequestContextSlot . APPSEC )
2550
- if (context. responseBodyTag) {
2551
- rqCtxt. traceSegment. setTagTop(' response.body' , body)
2552
- }
2554
+ context. responseBody = body
2553
2555
if (context. responseBlock) {
2554
2556
new RbaFlow (
2555
2557
new Flow.Action.RequestBlockingAction (413 , BlockingContentType . JSON )
You can’t perform that action at this time.
0 commit comments