koa 3.1.0 → 3.1.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/lib/response.js +4 -1
- package/package.json +1 -1
package/lib/response.js
CHANGED
|
@@ -139,7 +139,10 @@ module.exports = {
|
|
|
139
139
|
const cleanupPreviousStream = () => {
|
|
140
140
|
if (original && isStream(original)) {
|
|
141
141
|
original.once('error', () => {})
|
|
142
|
-
destroy
|
|
142
|
+
// Only destroy if the new value is not a stream
|
|
143
|
+
if (!isStream(val)) {
|
|
144
|
+
destroy(original)
|
|
145
|
+
}
|
|
143
146
|
}
|
|
144
147
|
}
|
|
145
148
|
|