Skip to content

Commit

Permalink
Update packages/dd-trace/src/appsec/reporter.js
Browse files Browse the repository at this point in the history
Co-authored-by: simon-id <[email protected]>
  • Loading branch information
uurien and simon-id authored Jun 24, 2024
1 parent 3cd1943 commit 3e25a3a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions packages/dd-trace/src/appsec/reporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,7 @@ function finishRequest (req, res) {
const newTags = filterHeaders(res.getHeaders(), RESPONSE_HEADERS_MAP)
Object.assign(newTags, filterHeaders(req.headers, REQUEST_HEADERS_MAP))

const appsecEvent = tags['appsec.event'] === 'true'
if (typeof req.route?.path === 'string' && appsecEvent) {
if (tags['appsec.event'] === 'true' && typeof req.route?.path === 'string') {
newTags['http.endpoint'] = req.route.path
}
rootSpan.addTags(newTags)
Expand Down

0 comments on commit 3e25a3a

Please sign in to comment.