Skip to content

Commit c25c8dc

Browse files
committed
linter
1 parent 329916f commit c25c8dc

File tree

7 files changed

+13
-10
lines changed

7 files changed

+13
-10
lines changed

packages/datadog-instrumentations/src/fastify.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,6 @@ addHook({ name: 'fastify', versions: ['1'] }, fastify => {
259259
return shimmer.wrapFunction(fastify, fastify => wrapFastify(fastify, false))
260260
})
261261

262-
263262
function wrapReplyHeader (Reply) {
264263
shimmer.wrap(Reply.prototype, 'header', header => function (key, value) {
265264
const result = header.apply(this, arguments)

packages/dd-trace/src/appsec/iast/analyzers/set-cookies-header-interceptor.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,11 @@ class SetCookiesHeaderInterceptor extends Plugin {
88
super()
99
this.cookiesInRequest = new WeakMap()
1010

11-
this.addSub('datadog:http:server:response:set-header:finish', ({ name, value, res }) => this._handleCookies(name, value, res))
12-
this.addSub('datadog:fastify:set-header:finish', ({ name, value, res }) => this._handleCookies(name, value, res))
11+
this.addSub('datadog:http:server:response:set-header:finish',
12+
({ name, value, res }) => this._handleCookies(name, value, res))
13+
14+
this.addSub('datadog:fastify:set-header:finish',
15+
({ name, value, res }) => this._handleCookies(name, value, res))
1316
}
1417

1518
_handleCookies (name, value, res) {

packages/dd-trace/src/appsec/iast/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,5 +123,4 @@ function onResponseWriteHeadCollect ({ res, responseHeaders = {} }) {
123123
}
124124
}
125125

126-
127126
module.exports = { enable, disable, onIncomingHttpRequestEnd, onIncomingHttpRequestStart }

packages/dd-trace/test/appsec/iast/analyzers/unvalidated-redirect-analyzer.spec.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,11 @@ describe('unvalidated-redirect-analyzer', () => {
9797
unvalidatedRedirectAnalyzer.configure(true)
9898

9999
it('should subscribe to set-header:finish channel', () => {
100-
expect(unvalidatedRedirectAnalyzer._subscriptions).to.have.lengthOf(1)
100+
expect(unvalidatedRedirectAnalyzer._subscriptions).to.have.lengthOf(2)
101101
expect(unvalidatedRedirectAnalyzer._subscriptions[0]._channel.name).to
102102
.equals('datadog:http:server:response:set-header:finish')
103+
expect(unvalidatedRedirectAnalyzer._subscriptions[1]._channel.name).to
104+
.equals('datadog:fastify:set-header:finish')
103105
})
104106

105107
it('should not report headers other than Location', () => {

packages/dd-trace/test/appsec/iast/taint-tracking/plugin.fastify.plugin.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const { URL } = require('url')
77
function noop () {}
88

99
describe('Taint tracking plugin sources fastify tests', () => {
10-
withVersions('fastify', 'fastify', version => {
10+
withVersions('fastify', 'fastify', '>=2', version => {
1111
prepareTestServerForIastInFastify('in fastify', version,
1212
(testThatRequestHasVulnerability, _, config) => {
1313
describe('tainted body', () => {

packages/dd-trace/test/appsec/iast/taint-tracking/plugin.spec.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ describe('IAST Taint tracking plugin', () => {
4949
})
5050

5151
it('Should subscribe to body parser, qs, cookie and process_params channel', () => {
52-
expect(taintTrackingPlugin._subscriptions).to.have.lengthOf(16)
52+
expect(taintTrackingPlugin._subscriptions).to.have.lengthOf(17)
5353
let i = 0
5454
expect(taintTrackingPlugin._subscriptions[i++]._channel.name).to.equals('datadog:body-parser:read:finish')
5555
expect(taintTrackingPlugin._subscriptions[i++]._channel.name).to.equals('datadog:multer:read:finish')
@@ -59,11 +59,12 @@ describe('IAST Taint tracking plugin', () => {
5959
expect(taintTrackingPlugin._subscriptions[i++]._channel.name).to.equals('datadog:fastify:query-params:finish')
6060
expect(taintTrackingPlugin._subscriptions[i++]._channel.name).to.equals('datadog:express:query:finish')
6161
expect(taintTrackingPlugin._subscriptions[i++]._channel.name).to.equals('datadog:cookie:parse:finish')
62+
expect(taintTrackingPlugin._subscriptions[i++]._channel.name).to.equals('datadog:fastify-cookie:read:finish')
6263
expect(taintTrackingPlugin._subscriptions[i++]._channel.name).to.equals('datadog:sequelize:query:finish')
6364
expect(taintTrackingPlugin._subscriptions[i++]._channel.name).to.equals('apm:pg:query:finish')
6465
expect(taintTrackingPlugin._subscriptions[i++]._channel.name).to.equals('datadog:express:process_params:start')
65-
expect(taintTrackingPlugin._subscriptions[i++]._channel.name).to.equals('datadog:fastify:path-params:finish')
6666
expect(taintTrackingPlugin._subscriptions[i++]._channel.name).to.equals('datadog:router:param:start')
67+
expect(taintTrackingPlugin._subscriptions[i++]._channel.name).to.equals('datadog:fastify:path-params:finish')
6768
expect(taintTrackingPlugin._subscriptions[i++]._channel.name).to.equals('apm:graphql:resolve:start')
6869
expect(taintTrackingPlugin._subscriptions[i++]._channel.name).to.equals('datadog:url:parse:finish')
6970
expect(taintTrackingPlugin._subscriptions[i++]._channel.name).to.equals('datadog:url:getter:finish')

packages/dd-trace/test/appsec/iast/taint-tracking/sources/taint-tracking.fastify.plugin.spec.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@ describe('Path params sourcing with fastify', () => {
122122
reply.code(200).send()
123123
})
124124

125-
126125
await appInstance.listen({ port: 0 })
127126

128127
const port = appInstance.server.address().port
@@ -132,4 +131,4 @@ describe('Path params sourcing with fastify', () => {
132131
expect(response.status).to.be.equal(200)
133132
})
134133
})
135-
})
134+
})

0 commit comments

Comments
 (0)