mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-14 20:40:17 -05:00
cfd0b39b96
update express and other dependencies GitOrigin-RevId: 22107eab0fa95d534ab07360548ae2b2123776db
57 lines
1.3 KiB
Diff
57 lines
1.3 KiB
Diff
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) {
|
|
// 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')
|
|
+ // })
|
|
}
|
|
|
|
/**
|