Skip to content

Commit ff26203

Browse files
committed
fix
1 parent c233763 commit ff26203

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

dd-java-agent/appsec/src/main/java/com/datadog/appsec/ddwaf/WAFModule.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ public void onDataAvailable(
446446
if (!reqCtx.isWafContextClosed()) {
447447
log.error("Error calling WAF", e);
448448
}
449-
incrementErrorCodeMetric(gwCtx, e.code);
449+
incrementErrorCodeMetric(reqCtx, gwCtx, e.code);
450450
return;
451451
} catch (AbstractWafException e) {
452452
incrementErrorCodeMetric(reqCtx, gwCtx, e.code);

dd-java-agent/appsec/src/test/groovy/com/datadog/appsec/ddwaf/WAFModuleSpecification.groovy

-2
Original file line numberDiff line numberDiff line change
@@ -1786,7 +1786,6 @@ class WAFModuleSpecification extends DDSpecification {
17861786
1 * wafMetricCollector.wafInit(Waf.LIB_VERSION, _, true)
17871787
1 * ctx.getRaspMetrics()
17881788
1 * ctx.getRaspMetricsCounter()
1789-
(0..1) * WafMetricCollector.get().wafRequestError() // TODO: remove this line when WAFModule is removed
17901789
1 * wafMetricCollector.raspErrorCode(RuleType.SQL_INJECTION, wafErrorCode.code)
17911790
0 * _
17921791

@@ -1815,7 +1814,6 @@ class WAFModuleSpecification extends DDSpecification {
18151814
1 * wafContext.run(_, _, _) >> { throw createWafException(wafErrorCode) }
18161815
1 * wafMetricCollector.wafInit(Waf.LIB_VERSION, _, true)
18171816
2 * ctx.getWafMetrics()
1818-
(0..1) * WafMetricCollector.get().wafRequestError() // TODO: remove this line when WAFModule is removed
18191817
1 * wafMetricCollector.wafErrorCode(wafErrorCode.code)
18201818
0 * _
18211819

0 commit comments

Comments
 (0)