Skip to content

Commit d62dfde

Browse files
fix: start supporting response.writableEnded in transaction's context. (#3430)
* fix: Start supporting response.writableEnded in transaction's context. Since response.finished property is deprecated as of the newer node versions and another property i.e. response.writableEnded is currently used in place of it. So start supporting reponse.writableEnded in transcation's context. Also, the change is backward compatible as the respone.finished is not removed yet. Fixes: #3428
1 parent 230740e commit d62dfde

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/parsers.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,11 @@ function getContextFromResponse (res, conf, isError) {
131131

132132
if (isError) {
133133
context.headers_sent = res.headersSent
134-
context.finished = res.finished
134+
if (typeof res.finished === 'boolean') {
135+
context.finished = res.finished
136+
} else {
137+
context.finished = res.writableEnded
138+
}
135139
}
136140

137141
return context

0 commit comments

Comments
 (0)