Skip to content

Commit

Permalink
Small changes
Browse files Browse the repository at this point in the history
  • Loading branch information
uurien committed Jun 17, 2024
1 parent 5b94ef6 commit 70fd11c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 24 deletions.
18 changes: 9 additions & 9 deletions integration-tests/appsec/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,39 +90,39 @@ describe('RASP', () => {
}
})

it('should not crash the app when app send data after blocking', () => {
it('should not crash when app send data after blocking', () => {
return testNotCrashedAfterBlocking('/ssrf/http/unhandled-async-write-A')
})

it('should not crash the app when app stream data after blocking', () => {
it('should not crash when app stream data after blocking', () => {
return testNotCrashedAfterBlocking('/ssrf/http/unhandled-async-write-B')
})

it('should not crash the app when setHeader, writeHead or end after blocking', () => {
it('should not crash when setHeader, writeHead or end after blocking', () => {
return testNotCrashedAfterBlocking('/ssrf/http/unhandled-async-write-C')
})

it('should not crash the app when appendHeader, flushHeaders, removeHeader after blocking', () => {
it('should not crash when appendHeader, flushHeaders, removeHeader after blocking', () => {
return testNotCrashedAfterBlocking('/ssrf/http/unhandled-async-write-D')
})

it('should not crash the app when writeContinue after blocking', () => {
it('should not crash when writeContinue after blocking', () => {
return testNotCrashedAfterBlocking('/ssrf/http/unhandled-async-write-E')
})

it('should not crash the app when writeProcessing after blocking', () => {
it('should not crash when writeProcessing after blocking', () => {
return testNotCrashedAfterBlocking('/ssrf/http/unhandled-async-write-F')
})

it('should not crash the app when writeEarlyHints after blocking', () => {
it('should not crash when writeEarlyHints after blocking', () => {
return testNotCrashedAfterBlocking('/ssrf/http/unhandled-async-write-G')
})

it('should not crash the app when res.json after blocking', () => {
it('should not crash when res.json after blocking', () => {
return testNotCrashedAfterBlocking('/ssrf/http/unhandled-async-write-H')
})

it('should not crash the when is blocked using axios', () => {
it('should not crash when is blocked using axios', () => {
return testNotCrashedAfterBlocking('/ssrf/http/unhandled-axios')
})
})
Expand Down
24 changes: 9 additions & 15 deletions packages/datadog-instrumentations/test/http.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,21 +81,15 @@ describe('client', () => {
assert.instanceOf(ctx.abortController, AbortController)
})

it('Request is aborted with default error', (done) => {
it('Request is aborted', (done) => {
startChannelCb.callsFake(abortCallback)

const cr = http.get(url, () => {
done('Request should be blocked')
done(new Error('Request should be blocked'))
})

cr.on('error', (e) => {
try {
assert.instanceOf(e, Error)

done()
} catch (e) {
done(e)
}
cr.on('error', () => {
done()
})
})

Expand All @@ -109,7 +103,7 @@ describe('client', () => {
})

const cr = http.get(url, () => {
done('Request should be blocked')
done(new Error('Request should be blocked'))
})

cr.on('error', (e) => {
Expand All @@ -128,7 +122,7 @@ describe('client', () => {
startChannelCb.callsFake(abortCallback)

const cr = http.get(url, () => {
done('Request should be blocked')
done(new Error('Request should be blocked'))
})

cr.on('error', () => {
Expand All @@ -147,7 +141,7 @@ describe('client', () => {
startChannelCb.callsFake(abortCallback)

const cr = http.get(url, () => {
done('Request should be blocked')
done(new Error('Request should be blocked'))
})

cr.on('error', () => {
Expand All @@ -167,7 +161,7 @@ describe('client', () => {
startChannelCb.callsFake(abortCallback)

const cr = http.get(url, () => {
done('Request should be blocked')
done(new Error('Request should be blocked'))
})

cr.on('error', () => {
Expand All @@ -183,7 +177,7 @@ describe('client', () => {
done(e.message)
}
})
}).timeout(1000)
})
})
})
})
Expand Down

0 comments on commit 70fd11c

Please sign in to comment.