Skip to content

Commit fbb45e7

Browse files
mccullsdevflow.devflow-routing-intake
andauthored
Fix a couple of IAST modules to use the IGSpanInfo in the event over the active span (#11934)
Fix a couple of IAST modules to use the IGSpanInfo in the event over the active span Co-authored-by: devflow.devflow-routing-intake <devflow.devflow-routing-intake@kubernetes.us1.ddbuild.io>
1 parent b9d1b57 commit fbb45e7

2 files changed

Lines changed: 2 additions & 4 deletions

File tree

dd-java-agent/agent-iast/src/main/java/com/datadog/iast/sink/HstsMissingHeaderModuleImpl.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
import datadog.trace.api.iast.IastContext;
1010
import datadog.trace.api.iast.sink.HstsMissingHeaderModule;
1111
import datadog.trace.bootstrap.instrumentation.api.AgentSpan;
12-
import datadog.trace.bootstrap.instrumentation.api.AgentTracer;
1312
import java.util.Locale;
1413
import java.util.Map;
1514
import java.util.regex.Matcher;
@@ -49,7 +48,7 @@ public void onRequestEnd(final IastContext ctx, final IGSpanInfo igSpanInfo) {
4948
if (!isHttps(urlString, iastRequestContext.getxForwardedProto())) {
5049
return;
5150
}
52-
final AgentSpan span = AgentTracer.activeSpan();
51+
final AgentSpan span = (AgentSpan) igSpanInfo;
5352
report(
5453
span, new Vulnerability(VulnerabilityType.HSTS_HEADER_MISSING, Location.forSpan(span)));
5554
} catch (Throwable e) {

dd-java-agent/agent-iast/src/main/java/com/datadog/iast/sink/XContentTypeModuleImpl.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
import datadog.trace.api.iast.IastContext;
1010
import datadog.trace.api.iast.sink.XContentTypeModule;
1111
import datadog.trace.bootstrap.instrumentation.api.AgentSpan;
12-
import datadog.trace.bootstrap.instrumentation.api.AgentTracer;
1312
import java.util.Locale;
1413
import java.util.Map;
1514
import javax.annotation.Nullable;
@@ -38,7 +37,7 @@ public void onRequestEnd(final IastContext ctx, final IGSpanInfo igSpanInfo) {
3837
if (isIgnorableResponseCode((Integer) tags.get("http.status_code"))) {
3938
return;
4039
}
41-
final AgentSpan span = AgentTracer.activeSpan();
40+
final AgentSpan span = (AgentSpan) igSpanInfo;
4241
report(
4342
span,
4443
new Vulnerability(

0 commit comments

Comments
 (0)