dd-trace 3.18.0 → 3.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/package.json +6 -6
  2. package/packages/datadog-instrumentations/src/body-parser.js +15 -9
  3. package/packages/datadog-instrumentations/src/express.js +32 -0
  4. package/packages/datadog-instrumentations/src/http/server.js +2 -1
  5. package/packages/datadog-instrumentations/src/playwright.js +3 -0
  6. package/packages/datadog-plugin-amqp10/src/consumer.js +1 -3
  7. package/packages/datadog-plugin-amqp10/src/producer.js +1 -3
  8. package/packages/datadog-plugin-amqplib/src/client.js +4 -3
  9. package/packages/datadog-plugin-amqplib/src/consumer.js +1 -3
  10. package/packages/datadog-plugin-amqplib/src/producer.js +1 -3
  11. package/packages/datadog-plugin-google-cloud-pubsub/src/client.js +4 -3
  12. package/packages/datadog-plugin-google-cloud-pubsub/src/consumer.js +1 -3
  13. package/packages/datadog-plugin-google-cloud-pubsub/src/producer.js +1 -3
  14. package/packages/datadog-plugin-http/src/server.js +2 -2
  15. package/packages/datadog-plugin-http2/src/server.js +0 -5
  16. package/packages/datadog-plugin-kafkajs/src/consumer.js +1 -4
  17. package/packages/datadog-plugin-kafkajs/src/producer.js +1 -3
  18. package/packages/datadog-plugin-rhea/src/consumer.js +1 -3
  19. package/packages/datadog-plugin-rhea/src/producer.js +1 -5
  20. package/packages/dd-trace/src/appsec/addresses.js +0 -3
  21. package/packages/dd-trace/src/appsec/blocked_templates.js +2 -9
  22. package/packages/dd-trace/src/appsec/blocking.js +1 -1
  23. package/packages/dd-trace/src/appsec/{gateway/channels.js → channels.js} +4 -4
  24. package/packages/dd-trace/src/appsec/iast/taint-tracking/plugin.js +1 -1
  25. package/packages/dd-trace/src/appsec/index.js +87 -79
  26. package/packages/dd-trace/src/appsec/recommended.json +448 -121
  27. package/packages/dd-trace/src/appsec/remote_config/apply_states.js +7 -0
  28. package/packages/dd-trace/src/appsec/remote_config/capabilities.js +2 -0
  29. package/packages/dd-trace/src/appsec/remote_config/index.js +29 -10
  30. package/packages/dd-trace/src/appsec/remote_config/manager.js +33 -12
  31. package/packages/dd-trace/src/appsec/reporter.js +27 -58
  32. package/packages/dd-trace/src/appsec/rule_manager.js +160 -32
  33. package/packages/dd-trace/src/appsec/sdk/user_blocking.js +4 -12
  34. package/packages/dd-trace/src/appsec/waf/index.js +75 -0
  35. package/packages/dd-trace/src/appsec/waf/waf_context_wrapper.js +57 -0
  36. package/packages/dd-trace/src/appsec/waf/waf_manager.js +66 -0
  37. package/packages/dd-trace/src/config.js +17 -1
  38. package/packages/dd-trace/src/encode/0.4.js +12 -4
  39. package/packages/dd-trace/src/plugin_manager.js +2 -0
  40. package/packages/dd-trace/src/plugins/client.js +3 -2
  41. package/packages/dd-trace/src/plugins/consumer.js +17 -2
  42. package/packages/dd-trace/src/plugins/inbound.js +7 -0
  43. package/packages/dd-trace/src/plugins/{outgoing.js → outbound.js} +2 -2
  44. package/packages/dd-trace/src/plugins/producer.js +17 -2
  45. package/packages/dd-trace/src/plugins/server.js +2 -2
  46. package/packages/dd-trace/src/plugins/tracing.js +11 -0
  47. package/packages/dd-trace/src/service-naming/index.js +41 -0
  48. package/packages/dd-trace/src/service-naming/schemas/definition.js +28 -0
  49. package/packages/dd-trace/src/service-naming/schemas/index.js +6 -0
  50. package/packages/dd-trace/src/service-naming/schemas/v0.js +66 -0
  51. package/packages/dd-trace/src/service-naming/schemas/v1.js +58 -0
  52. package/packages/dd-trace/src/appsec/callbacks/ddwaf.js +0 -137
  53. package/packages/dd-trace/src/appsec/callbacks/index.js +0 -7
  54. package/packages/dd-trace/src/appsec/gateway/als.js +0 -6
  55. package/packages/dd-trace/src/appsec/gateway/engine/engine.js +0 -140
  56. package/packages/dd-trace/src/appsec/gateway/engine/index.js +0 -51
  57. package/packages/dd-trace/src/appsec/gateway/engine/runner.js +0 -42
  58. package/packages/dd-trace/src/plugins/incoming.js +0 -7
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dd-trace",
3
- "version": "3.18.0",
3
+ "version": "3.19.0",
4
4
  "description": "Datadog APM tracing client for JavaScript",
5
5
  "main": "index.js",
6
6
  "typings": "index.d.ts",
@@ -15,10 +15,10 @@
15
15
  "lint": "node scripts/check_licenses.js && eslint . && yarn audit --groups dependencies",
16
16
  "services": "node ./scripts/install_plugin_modules && node packages/dd-trace/test/setup/services",
17
17
  "test": "SERVICES=* yarn services && mocha --colors --exit --expose-gc 'packages/dd-trace/test/setup/node.js' 'packages/*/test/**/*.spec.js'",
18
- "test:appsec": "mocha --colors --exit -r \"packages/dd-trace/test/setup/mocha.js\" --exclude \"packages/dd-trace/test/appsec/iast/**/*.plugin.spec.js\" \"packages/dd-trace/test/appsec/**/*.spec.js\"",
19
- "test:appsec:ci": "nyc --no-clean --include \"packages/dd-trace/src/appsec/**/*.js\" --exclude \"packages/dd-trace/test/appsec/iast/**/*.plugin.spec.js\" -- npm run test:appsec",
20
- "test:appsec:plugins": "mocha --colors --exit -r \"packages/dd-trace/test/setup/mocha.js\" \"packages/dd-trace/test/appsec/iast/**/*.@($(echo $PLUGINS)).plugin.spec.js\"",
21
- "test:appsec:plugins:ci": "yarn services && nyc --no-clean --include \"packages/dd-trace/test/appsec/iast/**/*.@($(echo $PLUGINS)).plugin.spec.js\" -- npm run test:appsec:plugins",
18
+ "test:appsec": "mocha --colors --exit -r \"packages/dd-trace/test/setup/mocha.js\" --exclude \"packages/dd-trace/test/appsec/**/*.plugin.spec.js\" \"packages/dd-trace/test/appsec/**/*.spec.js\"",
19
+ "test:appsec:ci": "nyc --no-clean --include \"packages/dd-trace/src/appsec/**/*.js\" --exclude \"packages/dd-trace/test/appsec/**/*.plugin.spec.js\" -- npm run test:appsec",
20
+ "test:appsec:plugins": "mocha --colors --exit -r \"packages/dd-trace/test/setup/mocha.js\" \"packages/dd-trace/test/appsec/**/*.@($(echo $PLUGINS)).plugin.spec.js\"",
21
+ "test:appsec:plugins:ci": "yarn services && nyc --no-clean --include \"packages/dd-trace/test/appsec/**/*.@($(echo $PLUGINS)).plugin.spec.js\" -- npm run test:appsec:plugins",
22
22
  "test:trace:core": "tap packages/dd-trace/test/*.spec.js \"packages/dd-trace/test/{ci-visibility,encode,exporters,opentracing,plugins,telemetry}/**/*.spec.js\"",
23
23
  "test:trace:core:ci": "npm run test:trace:core -- --coverage --nyc-arg=--include=\"packages/dd-trace/src/**/*.js\"",
24
24
  "test:instrumentations": "mocha --colors -r 'packages/dd-trace/test/setup/mocha.js' 'packages/datadog-instrumentations/test/**/*.spec.js'",
@@ -65,7 +65,7 @@
65
65
  "node": ">=14"
66
66
  },
67
67
  "dependencies": {
68
- "@datadog/native-appsec": "2.0.0",
68
+ "@datadog/native-appsec": "^3.1.0",
69
69
  "@datadog/native-iast-rewriter": "2.0.1",
70
70
  "@datadog/native-iast-taint-tracking": "^1.4.0",
71
71
  "@datadog/native-metrics": "^1.6.0",
@@ -1,14 +1,21 @@
1
1
  'use strict'
2
2
 
3
- const { channel, addHook, AsyncResource } = require('./helpers/instrument')
3
+ const { AbortController } = require('node-abort-controller') // AbortController is not available in node <15
4
+ const shimmer = require('../../datadog-shimmer')
5
+ const { channel, addHook } = require('./helpers/instrument')
4
6
 
5
7
  const bodyParserReadCh = channel('datadog:body-parser:read:finish')
6
8
 
7
- function publishRequestBodyAndNext (request, next) {
9
+ function publishRequestBodyAndNext (req, res, next) {
8
10
  return function () {
9
- if (bodyParserReadCh.hasSubscribers && request) {
10
- bodyParserReadCh.publish({ request })
11
+ if (bodyParserReadCh.hasSubscribers && req) {
12
+ const abortController = new AbortController()
13
+
14
+ bodyParserReadCh.publish({ req, res, abortController })
15
+
16
+ if (abortController.signal.aborted) return
11
17
  }
18
+
12
19
  next.apply(this, arguments)
13
20
  }
14
21
  }
@@ -16,11 +23,10 @@ function publishRequestBodyAndNext (request, next) {
16
23
  addHook({
17
24
  name: 'body-parser',
18
25
  file: 'lib/read.js',
19
- versions: ['>=1']
26
+ versions: ['>=1.4.0']
20
27
  }, read => {
21
- return function (req, res, next) {
22
- const nextResource = new AsyncResource('bound-anonymous-fn')
23
- arguments[2] = nextResource.bind(publishRequestBodyAndNext(req, next))
28
+ return shimmer.wrap(read, function (req, res, next) {
29
+ arguments[2] = publishRequestBodyAndNext(req, res, next)
24
30
  read.apply(this, arguments)
25
- }
31
+ })
26
32
  })
@@ -3,6 +3,7 @@
3
3
  const { createWrapRouterMethod } = require('./router')
4
4
  const shimmer = require('../../datadog-shimmer')
5
5
  const { addHook, channel } = require('./helpers/instrument')
6
+ const { AbortController } = require('node-abort-controller')
6
7
 
7
8
  const handleChannel = channel('apm:express:request:handle')
8
9
 
@@ -25,3 +26,34 @@ addHook({ name: 'express', versions: ['>=4'] }, express => {
25
26
 
26
27
  return express
27
28
  })
29
+
30
+ const queryParserReadCh = channel('datadog:query:read:finish')
31
+
32
+ function publishQueryParsedAndNext (req, res, next) {
33
+ return function () {
34
+ if (queryParserReadCh.hasSubscribers && req) {
35
+ const abortController = new AbortController()
36
+
37
+ queryParserReadCh.publish({ req, res, abortController })
38
+
39
+ if (abortController.signal.aborted) return
40
+ }
41
+
42
+ next.apply(this, arguments)
43
+ }
44
+ }
45
+
46
+ addHook({
47
+ name: 'express',
48
+ versions: ['>=4'],
49
+ file: 'lib/middleware/query.js'
50
+ }, query => {
51
+ return shimmer.wrap(query, function () {
52
+ const queryMiddleware = query.apply(this, arguments)
53
+
54
+ return shimmer.wrap(queryMiddleware, function (req, res, next) {
55
+ arguments[2] = publishQueryParsedAndNext(req, res, next)
56
+ return queryMiddleware.apply(this, arguments)
57
+ })
58
+ })
59
+ })
@@ -55,7 +55,8 @@ function wrapEmit (emit) {
55
55
 
56
56
  try {
57
57
  if (abortController.signal.aborted) {
58
- return res.end()
58
+ // TODO: should this always return true ?
59
+ return this.listenerCount(eventName) > 0
59
60
  }
60
61
  return emit.apply(this, arguments)
61
62
  } catch (err) {
@@ -72,6 +72,9 @@ function getRootDir (playwrightRunner) {
72
72
  if (playwrightRunner._configDir) {
73
73
  return playwrightRunner._configDir
74
74
  }
75
+ if (playwrightRunner._config && playwrightRunner._config.config) {
76
+ return playwrightRunner._config.config.rootDir
77
+ }
75
78
  return process.cwd()
76
79
  }
77
80
 
@@ -11,11 +11,9 @@ class Amqp10ConsumerPlugin extends ConsumerPlugin {
11
11
  const source = getShortName(link)
12
12
  const address = getAddress(link)
13
13
 
14
- this.startSpan('amqp.receive', {
15
- service: this.config.service || `${this.tracer._service}-amqp`,
14
+ this.startSpan({
16
15
  resource: ['receive', source].filter(v => v).join(' '),
17
16
  type: 'worker',
18
- kind: 'consumer',
19
17
  meta: {
20
18
  'amqp.link.source.address': source,
21
19
  'amqp.link.role': 'receiver',
@@ -13,10 +13,8 @@ class Amqp10ProducerPlugin extends ProducerPlugin {
13
13
  const address = getAddress(link)
14
14
  const target = getShortName(link)
15
15
 
16
- this.startSpan('amqp.send', {
17
- service: this.config.service || `${this.tracer._service}-amqp`,
16
+ this.startSpan({
18
17
  resource: ['send', target].filter(v => v).join(' '),
19
- kind: 'producer',
20
18
  meta: {
21
19
  'amqp.link.target.address': target,
22
20
  'amqp.link.role': 'sender',
@@ -7,6 +7,7 @@ const { getResourceName } = require('./util')
7
7
 
8
8
  class AmqplibClientPlugin extends ClientPlugin {
9
9
  static get id () { return 'amqplib' }
10
+ static get type () { return 'messaging' }
10
11
  static get operation () { return 'command' }
11
12
 
12
13
  start ({ channel = {}, method, fields }) {
@@ -14,10 +15,10 @@ class AmqplibClientPlugin extends ClientPlugin {
14
15
  if (method === 'basic.publish') return
15
16
 
16
17
  const stream = (channel.connection && channel.connection.stream) || {}
17
- const span = this.startSpan('amqp.command', {
18
- service: this.config.service || `${this.tracer._service}-amqp`,
18
+ const span = this.startSpan(this.operationName(), {
19
+ service: this.config.service || this.serviceName(),
19
20
  resource: getResourceName(method, fields),
20
- kind: 'client',
21
+ kind: this.constructor.kind,
21
22
  meta: {
22
23
  'out.host': stream._host,
23
24
  [CLIENT_PORT_KEY]: stream.remotePort,
@@ -13,11 +13,9 @@ class AmqplibConsumerPlugin extends ConsumerPlugin {
13
13
 
14
14
  const childOf = extract(this.tracer, message)
15
15
 
16
- this.startSpan('amqp.command', {
16
+ this.startSpan({
17
17
  childOf,
18
- service: this.config.service || `${this.tracer._service}-amqp`,
19
18
  resource: getResourceName(method, fields),
20
- kind: 'consumer',
21
19
  type: 'worker',
22
20
  meta: {
23
21
  'amqp.queue': fields.queue,
@@ -13,10 +13,8 @@ class AmqplibProducerPlugin extends ProducerPlugin {
13
13
  if (method !== 'basic.publish') return
14
14
 
15
15
  const stream = (channel.connection && channel.connection.stream) || {}
16
- const span = this.startSpan('amqp.command', {
17
- service: this.config.service || `${this.tracer._service}-amqp`,
16
+ const span = this.startSpan({
18
17
  resource: getResourceName(method, fields),
19
- kind: 'producer',
20
18
  meta: {
21
19
  'out.host': stream._host,
22
20
  [CLIENT_PORT_KEY]: stream.remotePort,
@@ -4,15 +4,16 @@ const ClientPlugin = require('../../dd-trace/src/plugins/client')
4
4
 
5
5
  class GoogleCloudPubsubClientPlugin extends ClientPlugin {
6
6
  static get id () { return 'google-cloud-pubsub' }
7
+ static get type () { return 'messaging' }
7
8
  static get operation () { return 'request' }
8
9
 
9
10
  start ({ request, api, projectId }) {
10
11
  if (api === 'publish') return
11
12
 
12
- this.startSpan('pubsub.request', {
13
- service: this.config.service || `${this.tracer._service}-pubsub`,
13
+ this.startSpan(this.operationName(), {
14
+ service: this.config.service || this.serviceName(),
14
15
  resource: [api, request.name].filter(x => x).join(' '),
15
- kind: 'client',
16
+ kind: this.constructor.kind,
16
17
  meta: {
17
18
  'pubsub.method': api,
18
19
  'gcloud.project_id': projectId
@@ -11,11 +11,9 @@ class GoogleCloudPubsubConsumerPlugin extends ConsumerPlugin {
11
11
  const topic = subscription.metadata && subscription.metadata.topic
12
12
  const childOf = this.tracer.extract('text_map', message.attributes) || null
13
13
 
14
- this.startSpan('pubsub.receive', {
14
+ this.startSpan({
15
15
  childOf,
16
- service: this.config.service,
17
16
  resource: topic,
18
- kind: 'consumer',
19
17
  type: 'worker',
20
18
  meta: {
21
19
  'gcloud.project_id': subscription.pubsub.projectId,
@@ -11,10 +11,8 @@ class GoogleCloudPubsubProducerPlugin extends ProducerPlugin {
11
11
 
12
12
  const messages = request.messages || []
13
13
  const topic = request.topic
14
- const span = this.startSpan('pubsub.request', { // TODO: rename
15
- service: this.config.service || `${this.tracer._service}-pubsub`,
14
+ const span = this.startSpan({ // TODO: rename
16
15
  resource: `${api} ${topic}`,
17
- kind: 'producer',
18
16
  meta: {
19
17
  'gcloud.project_id': projectId,
20
18
  'pubsub.method': api, // TODO: remove
@@ -3,7 +3,7 @@
3
3
  const Plugin = require('../../dd-trace/src/plugins/plugin')
4
4
  const { storage } = require('../../datadog-core')
5
5
  const web = require('../../dd-trace/src/plugins/util/web')
6
- const { incomingHttpRequestStart, incomingHttpRequestEnd } = require('../../dd-trace/src/appsec/gateway/channels')
6
+ const { incomingHttpRequestStart, incomingHttpRequestEnd } = require('../../dd-trace/src/appsec/channels')
7
7
  const { COMPONENT } = require('../../dd-trace/src/constants')
8
8
 
9
9
  class HttpServerPlugin extends Plugin {
@@ -33,7 +33,7 @@ class HttpServerPlugin extends Plugin {
33
33
  }
34
34
 
35
35
  if (incomingHttpRequestStart.hasSubscribers) {
36
- incomingHttpRequestStart.publish({ req, res, abortController })
36
+ incomingHttpRequestStart.publish({ req, res, abortController }) // TODO: no need to make a new object here
37
37
  }
38
38
  })
39
39
 
@@ -5,7 +5,6 @@
5
5
  const Plugin = require('../../dd-trace/src/plugins/plugin')
6
6
  const { storage } = require('../../datadog-core')
7
7
  const web = require('../../dd-trace/src/plugins/util/web')
8
- const { incomingHttpRequestStart } = require('../../dd-trace/src/appsec/gateway/channels')
9
8
  const { COMPONENT } = require('../../dd-trace/src/constants')
10
9
 
11
10
  class Http2ServerPlugin extends Plugin {
@@ -30,10 +29,6 @@ class Http2ServerPlugin extends Plugin {
30
29
  context.res.writeHead = web.wrapWriteHead(context)
31
30
  context.instrumented = true
32
31
  }
33
-
34
- if (incomingHttpRequestStart.hasSubscribers) {
35
- incomingHttpRequestStart.publish({ req, res })
36
- }
37
32
  })
38
33
 
39
34
  this.addSub('apm:http2:server:request:error', (error) => {
@@ -8,12 +8,9 @@ class KafkajsConsumerPlugin extends ConsumerPlugin {
8
8
 
9
9
  start ({ topic, partition, message }) {
10
10
  const childOf = extract(this.tracer, message.headers)
11
-
12
- this.startSpan('kafka.consume', {
11
+ this.startSpan({
13
12
  childOf,
14
- service: this.config.service || `${this.tracer._service}-kafka`,
15
13
  resource: topic,
16
- kind: 'consumer',
17
14
  type: 'worker',
18
15
  meta: {
19
16
  'component': 'kafkajs',
@@ -7,10 +7,8 @@ class KafkajsProducerPlugin extends ProducerPlugin {
7
7
  static get operation () { return 'produce' }
8
8
 
9
9
  start ({ topic, messages }) {
10
- const span = this.startSpan('kafka.produce', {
11
- service: this.config.service || `${this.tracer._service}-kafka`,
10
+ const span = this.startSpan({
12
11
  resource: topic,
13
- kind: 'producer',
14
12
  meta: {
15
13
  'component': 'kafkajs',
16
14
  'kafka.topic': topic
@@ -19,12 +19,10 @@ class RheaConsumerPlugin extends ConsumerPlugin {
19
19
  const name = getResourceNameFromMessage(msgObj)
20
20
  const childOf = extractTextMap(msgObj, this.tracer)
21
21
 
22
- this.startSpan('amqp.receive', {
22
+ this.startSpan({
23
23
  childOf,
24
- service: this.config.service,
25
24
  resource: name,
26
25
  type: 'worker',
27
- kind: 'consumer',
28
26
  meta: {
29
27
  'component': 'rhea',
30
28
  'amqp.link.source.address': name,
@@ -9,17 +9,13 @@ class RheaProducerPlugin extends ProducerPlugin {
9
9
 
10
10
  constructor (...args) {
11
11
  super(...args)
12
-
13
12
  this.addTraceSub('encode', this.encode.bind(this))
14
13
  }
15
14
 
16
15
  start ({ targetAddress, host, port }) {
17
16
  const name = targetAddress || 'amq.topic'
18
-
19
- this.startSpan('amqp.send', {
20
- service: this.config.service || `${this.tracer._service}-amqp-producer`,
17
+ this.startSpan({
21
18
  resource: name,
22
- kind: 'producer',
23
19
  meta: {
24
20
  'component': 'rhea',
25
21
  'amqp.link.target.address': name,
@@ -7,14 +7,11 @@ module.exports = {
7
7
  // TODO: 'server.request.trailers',
8
8
  HTTP_INCOMING_URL: 'server.request.uri.raw',
9
9
  HTTP_INCOMING_METHOD: 'server.request.method',
10
- HTTP_INCOMING_ENDPOINT: 'server.request.framework_endpoint',
11
10
  HTTP_INCOMING_PARAMS: 'server.request.path_params',
12
11
  HTTP_INCOMING_COOKIES: 'server.request.cookies',
13
12
  HTTP_INCOMING_RESPONSE_CODE: 'server.response.status',
14
13
  HTTP_INCOMING_RESPONSE_HEADERS: 'server.response.headers.no_cookies',
15
14
  // TODO: 'server.response.trailers',
16
- HTTP_INCOMING_REMOTE_IP: 'server.request.client_ip',
17
- HTTP_INCOMING_REMOTE_PORT: 'server.request.client_port',
18
15
 
19
16
  HTTP_CLIENT_IP: 'http.client_ip',
20
17
 
@@ -1,7 +1,7 @@
1
1
  /* eslint-disable max-len */
2
2
  'use strict'
3
3
 
4
- const html = `<!-- Sorry, you've been blocked -->
4
+ const html = `<!-- Sorry, youve been blocked -->
5
5
  <!DOCTYPE html>
6
6
  <html lang="en">
7
7
 
@@ -102,14 +102,7 @@ const html = `<!-- Sorry, you've been blocked -->
102
102
  </html>
103
103
  `
104
104
 
105
- const json = `{
106
- "errors": [
107
- {
108
- "title": "You've been blocked",
109
- "detail": "Sorry, you cannot access this page. Please contact the customer service team. Security provided by Datadog."
110
- }
111
- ]
112
- }`
105
+ const json = `{"errors": [{"title": "You've been blocked", "detail": "Sorry, you cannot access this page. Please contact the customer service team. Security provided by Datadog."}]}`
113
106
 
114
107
  module.exports = {
115
108
  html,
@@ -19,7 +19,7 @@ function block (req, res, rootSpan, abortController) {
19
19
  const accept = req.headers.accept && req.headers.accept.split(',').map((str) => str.split(';', 1)[0].trim())
20
20
 
21
21
  if (accept && accept.includes('text/html') && !accept.includes('application/json')) {
22
- type = 'text/html'
22
+ type = 'text/html; charset=utf-8'
23
23
  body = templateHtml
24
24
  } else {
25
25
  type = 'application/json'
@@ -1,11 +1,11 @@
1
1
  'use strict'
2
2
 
3
- const dc = require('../../../../diagnostics_channel')
3
+ const dc = require('../../../diagnostics_channel')
4
4
 
5
5
  // TODO: use TBD naming convention
6
- // or directly use http plugin's channels
7
- // when it gets converted to new plugin system
8
6
  module.exports = {
9
7
  incomingHttpRequestStart: dc.channel('dd-trace:incomingHttpRequestStart'),
10
- incomingHttpRequestEnd: dc.channel('dd-trace:incomingHttpRequestEnd')
8
+ incomingHttpRequestEnd: dc.channel('dd-trace:incomingHttpRequestEnd'),
9
+ bodyParser: dc.channel('datadog:body-parser:read:finish'),
10
+ queryParser: dc.channel('datadog:query:read:finish')
11
11
  }
@@ -12,7 +12,7 @@ class TaintTrackingPlugin extends Plugin {
12
12
  this._type = 'taint-tracking'
13
13
  this.addSub(
14
14
  'datadog:body-parser:read:finish',
15
- ({ request }) => this._taintTrackingHandler(HTTP_REQUEST_BODY, request, 'body')
15
+ ({ req }) => this._taintTrackingHandler(HTTP_REQUEST_BODY, req, 'body')
16
16
  )
17
17
  this.addSub(
18
18
  'datadog:qs:parse:finish',