Skip to content

Commit b4d0e6e

Browse files
committed
fix(appsec): include filenames callback in Netty multipart early-return gate
requestFilesFilenames() was consulted after data collection, so when it was the only registered AppSec callback (no requestBodyProcessed, no requestFilesContent) the early-return gate fired and filenames were never published to the WAF. Fetch all three callbacks upfront and gate on all three.
1 parent 2bf3304 commit b4d0e6e

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

dd-java-agent/instrumentation/netty/netty-4.1/src/main/java/datadog/trace/instrumentation/netty41/HttpPostRequestDecoderInstrumentation.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,13 @@ static void after(
108108
BiFunction<RequestContext, Object, Flow<Void>> callback =
109109
cbp.getCallback(EVENTS.requestBodyProcessed());
110110

111+
BiFunction<RequestContext, List<String>, Flow<Void>> filenamesCb =
112+
cbp.getCallback(EVENTS.requestFilesFilenames());
113+
111114
BiFunction<RequestContext, List<String>, Flow<Void>> contentCb =
112115
cbp.getCallback(EVENTS.requestFilesContent());
113116

114-
if (callback == null && contentCb == null) {
117+
if (callback == null && filenamesCb == null && contentCb == null) {
115118
return;
116119
}
117120

@@ -163,8 +166,6 @@ static void after(
163166
}
164167

165168
if (!filenames.isEmpty()) {
166-
BiFunction<RequestContext, List<String>, Flow<Void>> filenamesCb =
167-
cbp.getCallback(EVENTS.requestFilesFilenames());
168169
if (filenamesCb != null) {
169170
Flow<Void> filenamesFlow = filenamesCb.apply(requestContext, filenames);
170171
Flow.Action filenamesAction = filenamesFlow.getAction();

0 commit comments

Comments
 (0)