2024-09-26 10:37:04 +00:00
|
|
|
diff --git a/node_modules/send/index.js b/node_modules/send/index.js
|
|
|
|
index 768f8ca..a882f4d 100644
|
|
|
|
--- a/node_modules/send/index.js
|
|
|
|
+++ b/node_modules/send/index.js
|
|
|
|
@@ -788,29 +788,29 @@ SendStream.prototype.stream = function stream (path, options) {
|
2023-05-24 08:24:28 +00:00
|
|
|
// pipe
|
|
|
|
var stream = fs.createReadStream(path, options)
|
|
|
|
this.emit('stream', stream)
|
|
|
|
- stream.pipe(res)
|
|
|
|
-
|
|
|
|
- // cleanup
|
|
|
|
- function cleanup () {
|
|
|
|
- destroy(stream, true)
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- // response finished, cleanup
|
|
|
|
- onFinished(res, cleanup)
|
|
|
|
-
|
|
|
|
- // error handling
|
|
|
|
- stream.on('error', function onerror (err) {
|
|
|
|
- // clean up stream early
|
|
|
|
- cleanup()
|
|
|
|
-
|
|
|
|
- // error
|
|
|
|
- self.onStatError(err)
|
|
|
|
- })
|
|
|
|
-
|
|
|
|
- // end
|
|
|
|
- stream.on('end', function onend () {
|
|
|
|
- self.emit('end')
|
|
|
|
- })
|
|
|
|
+ Stream.pipeline(stream, res, err => { if (err) { self.onStatError(err) } else { self.emit('end') } })
|
|
|
|
+
|
|
|
|
+ // // cleanup
|
|
|
|
+ // function cleanup () {
|
|
|
|
+ // destroy(stream, true)
|
|
|
|
+ // }
|
|
|
|
+ //
|
|
|
|
+ // // response finished, cleanup
|
|
|
|
+ // onFinished(res, cleanup)
|
|
|
|
+ //
|
|
|
|
+ // // error handling
|
|
|
|
+ // stream.on('error', function onerror (err) {
|
|
|
|
+ // // clean up stream early
|
|
|
|
+ // cleanup()
|
|
|
|
+ //
|
|
|
|
+ // // error
|
|
|
|
+ // self.onStatError(err)
|
|
|
|
+ // })
|
|
|
|
+ //
|
|
|
|
+ // // end
|
|
|
|
+ // stream.on('end', function onend () {
|
|
|
|
+ // self.emit('end')
|
|
|
|
+ // })
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|