Skip to content

Commit fe1c534

Browse files
committed
Move res.end()
1 parent 9dcb293 commit fe1c534

File tree

1 file changed

+4
-2
lines changed
  • packages/dd-trace/test/appsec/iast

1 file changed

+4
-2
lines changed

packages/dd-trace/test/appsec/iast/utils.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,14 +119,16 @@ function beforeEachIastTest () {
119119
function endResponse (res, appResult) {
120120
if (appResult && typeof appResult.then === 'function') {
121121
appResult.then(() => {
122-
res.writeHead(200)
122+
if (!res.headersSent) {
123+
res.writeHead(200)
124+
}
123125
res.end()
124126
})
125127
} else {
126128
if (!res.headersSent) {
127129
res.writeHead(200)
128-
res.end()
129130
}
131+
res.end()
130132
}
131133
}
132134

0 commit comments

Comments
 (0)