Skip to content

Commit 367bd2d

Browse files
authored
Discard non-web traces when searching for a vulnerability not being present (#4871)
1 parent 1ee8000 commit 367bd2d

File tree

1 file changed

+1
-0
lines changed
  • packages/dd-trace/test/appsec/iast

1 file changed

+1
-0
lines changed

packages/dd-trace/test/appsec/iast/utils.js

+1
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ function endResponse (res, appResult) {
136136
function checkNoVulnerabilityInRequest (vulnerability, config, done, makeRequest) {
137137
agent
138138
.use(traces => {
139+
if (traces[0][0].type !== 'web') throw new Error('Not a web span')
139140
// iastJson == undefiend is valid
140141
const iastJson = traces[0][0].meta['_dd.iast.json'] || ''
141142
expect(iastJson).to.not.include(`"${vulnerability}"`)

0 commit comments

Comments
 (0)