dd-trace 2.9.0 → 2.9.1

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dd-trace",
3
- "version": "2.9.0",
3
+ "version": "2.9.1",
4
4
  "description": "Datadog APM tracing client for JavaScript",
5
5
  "main": "index.js",
6
6
  "typings": "index.d.ts",
@@ -85,8 +85,8 @@ function wrapAddHook (addHook) {
85
85
  }
86
86
  }
87
87
 
88
- function onRequest (request, reply, next) {
89
- if (typeof next !== 'function') return
88
+ function onRequest (request, reply, done) {
89
+ if (typeof done !== 'function') return
90
90
 
91
91
  const req = getReq(request)
92
92
  const res = getRes(reply)
@@ -96,37 +96,41 @@ function onRequest (request, reply, next) {
96
96
 
97
97
  return requestResource.runInAsyncScope(() => {
98
98
  handleChannel.publish({ req, res })
99
- return next()
99
+ return done()
100
100
  })
101
101
  }
102
102
 
103
- function preHandler (request, reply, next) {
104
- if (typeof next !== 'function') return
105
- if (!reply || typeof reply.send !== 'function') return next()
103
+ function preHandler (request, reply, done) {
104
+ if (typeof done !== 'function') return
105
+ if (!reply || typeof reply.send !== 'function') return done()
106
106
 
107
107
  const req = getReq(request)
108
108
  const requestResource = requestResources.get(req)
109
109
 
110
110
  reply.send = wrapSend(reply.send, requestResource)
111
111
 
112
- next()
112
+ done()
113
113
  }
114
114
 
115
- function preValidation (request, reply, next) {
115
+ function preValidation (request, reply, done) {
116
116
  const req = getReq(request)
117
117
  const parsingResource = parsingResources.get(req)
118
118
 
119
- if (!parsingResource) return next()
119
+ if (!parsingResource) return done()
120
120
 
121
- parsingResource.runInAsyncScope(() => next())
121
+ parsingResource.runInAsyncScope(() => done())
122
122
  }
123
123
 
124
- function preParsing (request, reply, next) {
124
+ function preParsing (request, reply, payload, done) {
125
+ if (typeof done !== 'function') {
126
+ done = payload
127
+ }
128
+
125
129
  const req = getReq(request)
126
130
  const parsingResource = new AsyncResource('bound-anonymous-fn')
127
131
 
128
132
  parsingResources.set(req, parsingResource)
129
- parsingResource.runInAsyncScope(() => next())
133
+ parsingResource.runInAsyncScope(() => done())
130
134
  }
131
135
 
132
136
  function wrapSend (send, resource) {
@@ -1 +1 @@
1
- module.exports = '2.9.0'
1
+ module.exports = '2.9.1'