Skip to content

Commit

Permalink
Discard non-web traces when searching for a vulnerability not being p…
Browse files Browse the repository at this point in the history
…resent (#4871)
  • Loading branch information
CarlesDD authored Nov 8, 2024
1 parent 1ee8000 commit 367bd2d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions packages/dd-trace/test/appsec/iast/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ function endResponse (res, appResult) {
function checkNoVulnerabilityInRequest (vulnerability, config, done, makeRequest) {
agent
.use(traces => {
if (traces[0][0].type !== 'web') throw new Error('Not a web span')
// iastJson == undefiend is valid
const iastJson = traces[0][0].meta['_dd.iast.json'] || ''
expect(iastJson).to.not.include(`"${vulnerability}"`)
Expand Down

0 comments on commit 367bd2d

Please sign in to comment.