Commit bece336
committed
fix(appsec): guard Jetty 8 getParts against repeated calls; disable filename tests in async suite
1. Add _multiPartInputStream == null guard to GetFilenamesAdvice.before() so that
repeated getParts() calls on the same request (which Jetty caches) do not
re-fire requestFilesFilenames/requestBodyProcessed WAF callbacks. The field is
null before the first multipart parse and non-null on all subsequent cached
calls, matching the pattern used in the 9.4/11.0 advice (_multiParts guard).
2. JettyAsyncHandlerTest already disabled testBodyFilenames() but neglected to
disable testBodyFilenamesCalledOnce() and testBodyFilenamesCalledOnceCombined(),
which are now enabled in the Jetty11Test parent. Override both to false in the
async handler suite to prevent spurious test failures.1 parent 1508fef commit bece336
2 files changed
Lines changed: 17 additions & 2 deletions
File tree
- dd-java-agent/instrumentation/jetty
- jetty-appsec/jetty-appsec-8.1.3/src/main/java/datadog/trace/instrumentation/jetty8
- jetty-server/jetty-server-11.0/src/test/groovy
Lines changed: 7 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| |||
129 | 130 | | |
130 | 131 | | |
131 | 132 | | |
132 | | - | |
133 | | - | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
134 | 139 | | |
135 | 140 | | |
136 | 141 | | |
| |||
Lines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
33 | 43 | | |
34 | 44 | | |
35 | 45 | | |
| |||
0 commit comments